A more legit way of getting actually controlled undead:
20th level necromancy wizard - 158 beefy skeletons
Level 20 wizard with the necromancy specialization is going to be your best way of getting the strongest and most numerous undead horde, without relying on dubious coffeelock cheese that no sane DM will ever allow.
With necromancy specialization, every casting of the spell will allow you to raise (but not remain in control of) one extra corpse.
At this level, you will have 3 3rd, 3 4th, 3 5th 2 6th, 2 7th, 1 8th and 1 9th level spellslot. In addition, you can cast a third level signature spell once per short rest, which we'll also be using to cast Animate Dead.
Arcane Recovery can be used once per day to regain 20 spell levels worth of slots, but only up to 6th level. Best bang for your buck for animating undead is 2 6th, 1 5th and 1 third level spell slot.
Assuming a reasonable DM allows you to short rest twice in a day, together with a good night's rest, you will be casting, in a day:
6 3rd, 3 4th, 4 5th, 4 6th, 2 7th, 1 8th and 1 9th level Animate Dead.
The amount of undead you can raise or control per level:
3rd: Raise 2, maintain control over 4
4th: Raise 4, maintain control over 6
5th: Raise 6, maintain control over 8
6th: Raise 8, maintain control over 10
7th: Raise 10, maintain control over 12
8th: Raise 12, maintain control over 14
9th: Raise 14, maintain control over 16
This means that on your first day, you will raise:
6×2+3×4+4×6+4×8+2×10+12+14 = 126 skeletons.
You've deserved a nap after that, so take a good night's rest.
All rested up? Good.
First, we want to make certain we maintain control over all the undead, they are no good to us wandering around aimlessly. 126 skeletons will require us to cast:
3 3rd (12 maintained), 3 4th (18 maintained), 4 5th (32 maintained),4 6th (40 maintained), 2 7th (24 maintained) for a total of 126 skeletons maintained.
We have 3 3rd, 1 8th and 1 9th level spellslot left, which we can use to raise another 32 skeltons, for a grand total of 158 skeletons that are under our control.
You can possibly squeeze out a few more in your 48 hour timespan if you try to abuse the timeframe by raising undead that won't be under your control for much longer, but this is the most straight forward, legit way of without a doubt raising 158 skeletons under your control.
As an added bonus, their hitpoints are 20 higher than a normal skeletons (33 instead of 13), its weapon attacks deal an extra 5 damage (for 1d6+7 in most normal cases). Your skeleton has a 1 in 6 chance of one-shotting a normal skeleton without a critical hit, and even a critical hit from an opponent skeleton has no chance of one-shotting one of your skeletons.
If for some insane reason your DM allows you to long rest more than once per day, or allows infinite short rests like coffeelock assumes, you'll be able to squeeze out extra skeletons, because every extra short rest means another casting of Animate Dead.