So some of the “solutions” to fighting multiple enemies at a time include rules like multiple attacks for fighter progression, mighty cleave (kill enemy to get an attack to kill another enemy to get another attack, etc) and a few others.
Truthfully, I'm sure these work fine, but I somewhat dislike multiple attacks because it slows the game down and seems too multiplicative powerful. If you get a level up where you deal +1 to hit and/or damage and then another level up where you get an extra attack that's a huge power spike; not just double potential damage but more chances to hit, since even if your first hit misses you get another chance. Mighty Cleave rule is also really nice, elegant, but it also encourages a kind of weird playstyle of killing all the minions or weak dudes before attacking the dude with the most hit points, since that way you get the most attacks, and also turns the fighter's turn into a bunch of rolls an damage and rolls and damage and back to back stuff.
Thinking on it a bit more; I suddenly came up with a very simple idea. I have no idea if this has been done before, it probably has in somebody's rulebook, but I haven't personally seen it. Still, I don't want to claim ownership of this idea since its so simple. I will instead take credit for the design philosophy; make the Fighter do more damage on a hit, which not only makes them better with single targets, but also with this move.
If the Fighter wants to attack multiple enemies, they simply declare how many enemies they are trying to hit with one blow. This must be declared before any to-hit dice are rolled.
Then, the Fighter rolls a to-hit for every enemy they are trying to attack. The ones that are hit will take a portion of the damage, the attacks that miss have avoided the attack.
When the damage is rolled, simply divide the amount of damage you deal among all the enemies you attempted to strike, rounding down. ie, slicing at three goblins with your greatsword, roll damage of 10. Divide by three and round down; each goblin takes three damage. One of the goblins wasn't hit because they had a shield; you still only deal three damage to the two remaining goblins.
You can attack as many enemies with your weapon as you could reasonably hit- one handed weapons could swing and hit the two abreast orcs in the hallway in front of you, where as two handed weapons could potentially sweep everything around you at once. Weapons like daggers and rapiers probably can't attack multiple enemies at once, unless you had some kind of insane speed or dexterity that let you stab that fast, or maybe a spear could be shoved through one guy and hit a bunch of guys in a line, but couldn't be swung in a arc very well.
This is a very simple mechanic, and only requires a little math. Things like damage resistance and damage reduction apply after the damage has been divided and dealt. All types of damage are also applied evenly; a sword of fire will divide its fire damage and slashing/physical damage evenly among all the targets hit, all the fire won't just selectively target the troll.
Note: Monsters can also use this. Maybe you like that idea because instead of feeling like the giant is picking on one player with its 1d12 big club attack, it's going to sweep it around and hit multiple party members for between 0 to 4 damage. Also makes giant monsters feel a bit different to fight, they're hitting half your party instead of just going one on one like all the human sized enemies with single target weapons like swords.
Note Note: I'm more fluffing this as a single big wide swing as opposed to multiple attacks. You could just use multiple attacks for this, but I'm specifically avoiding it because two handed weapons are implied to be best for it (higher max damage) and because it might strain believably (why is your guy stabbing three people and dealing less damage then if he just stabs one?)
Note3: You might be tempted to make this deal a minimum of 1 damage on damage split up, just in case the player rolls a 1 on their damage roll, but I disagree with that decision. It might be a waste of their turn, but players can already waste their combat turn by missing an attack, so who cares. Plus rounding it up to 1 means that it may encourage annoying tactics, like swinging a flail around in a big circle to try and hit 6 or more enemies on a single attack, which would eventually clear a room of goblins either way but just seems dumb. This way, you can bounce off enemy armor which fits the fiction a little better then lucky scraps and bumps dealing significant damage.