Swarm: A swarm is considered a single monster even though it is composed of several Tiny creatures. Most single swarms are Medium, but some can be larger.
A swarm takes half damage from melee and ranged attacks. It is vulnerable to close and area attacks, as indicated in the monster’s stat block.
A swarm is immune to forced movement (pull, push, and slide) effects from melee and ranged attacks. Close or area attacks that impose forced movement affect the swarm normally.
A swarm can enter or move through an enemy’s space; this movement does not provoke opportunity attacks. An enemy can enter a space occupied by a swarm, but the space occupied by the swarm is considered difficult terrain, and doing so provokes an opportunity attack.
A swarm can squeeze through any opening large enough to accommodate even one of its constituent creatures. For example, a swarm of bats can squeeze through any opening large enough for one of the bats to squeeze through. See the Player’s Handbook for squeezing rules.