I was doing research on mass combat rules for D&D 5e for …reasons… and I know there's nothing completely official. There is a 2017 Unearthed Arcana for Mass Combat [PDF] published by Wizards of the Coast. In fact, there are two PDFs for this, the other likely from 2015.
In previous editions, there were the Battlesystem rules, especially the Battlesystem 2nd Edition that I was most familiar with. These were D&D's answer to other miniatures combat rules from Ral Partha et al.
In 3rd edition, there were two books, Heroes of Battle and the Miniatures Handbook that could be used for the same purpose.
But as far as an official mass combat system for 5e, there is only the playtest UA stuff above. In my research, I stumbled upon my same question on a Reddit post from a few months back.
Posts from the dndnext
community on Reddit
And one of the commenters suggested setting up stats for large groups as swarms and then run normal combat. And they linked to a page on The Homebrewery for Humanoid Swarms. This is an interesting idea because it simply enhances the monster stat block for one humanoid and expands it to an unnumbered swarm of variable size. The sizes match monster sizes above medium; large, huge and gargantuan.
- Commoner → Mob of Commoners
- Pikeman → Pike Square
- Archer → Mass of Archers
- Bodyguard → Company of Guards
- Hedge Witch → Coven of Witches
Another reason that this catches my eye is that one of the …reasons… or themes matching why I started searching this in the first place was that I wanted something remniscent of an old video game that I was a huge fan of growing up called Ancient Art of War on the Macintosh Plus (1985). There were three troop types in that game; knights, archers, and barbarians. Along with other rules, the combat advantage for the three types was similar to rock-paper-scissors.
- Knights, with their heavy armor, were strong against barbarians, but too slow to deal with archers.
- Barbarians were quick and nimble, easily crossing the battlefield to defeat archers, but fell easily to knights.
- Archers could fire volleys of arrows and easily defeat knights, but could not hit barbarians with any accuracy.
The "swarm of humanoids" has some ideas in common with this.
- Pikemen are clearly knights...
- Archers, archers
- Bodyguards are potentially barbarians (although...)
So it would be possible to use this a bit. The problem I anticipate is that you can't have a mixed squad of barbs and archers and knights in varying numbers. This was almost always a strategic way to win in Ancient Art of War. Here's some nostalgic gameplay footage I'm saving just for myself.
Bonus: Check out more along these lines with a post named mass combat belongs in the monster manual on Blog of Holding.