Monster Manual said: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.
There are 2 ways you can mean this. Do you mean you want guidelines for making a swarm OF monsters of some sort? Or do you mean you want to change an existing stat block to represent a swarm? (IE reskinning with the added variation of including the swarm keyword).
Unfortunately there are no swarm-making guidelines in any of the books as far as I know, but then again, I don't think there are any comprehensive guides on creating enemy leaders or soldiers and so forth. Personally I've simply adapted existing swarms to suit my needs, or taken a trait or attack from this or that enemy.

(Dungeons & Dragons)
Rulebook featuring "high magic" options, including a host of new spells.