The pants-shitter argument against all this is that an ancient dragon's fear aura has a range of 120 feet, which is within longbow range of 150 ft. Typically, the breath weapon has a range of 90 ft. Thus all the peasants will coordinate with the Ready action to ensure they all volley when the dragon gets within 120 feet to try anything. One might go with a shortbow, but it has disadvantage on attacks beyond 80 feet. With the dragon's AC of 20+, peasants need to crit to hit, giving them just a 1/400 chance of hittting.
All of these theorycraft exercises take place in infinite planes with empty skies, of course.
If you raised an army of peasants to go fight a dragon, it'd break and run away the moment it got hit with dragon breath. Does 5e even have morale rules or is it assumed everone fights to the death or until the GM eyeballs it and says they should run or surrender? Though even without morale rules, dragon fear should make it difficult for armies to fight dragons without magical help.
Everything there isn't a rule for in 5e is covered by the DM's judgement. So let's say how I would deal with this should an
absolute faggot at my table try the "army of peasants" trick to defeat an ancient red dragon, Smokey Steve.
Absolute faggot: I'm going to raise an army of peasants. 2,000 should do the trick.
Me: Okay, we'll use the tool proficiency rules. It takes 250 days and 250 gp per peasant to train them how to use longbows. Do you have 500,000 gp?
AF: Well, I was planning to have them do this without training. They should be proficient in shortbows.
Me: Sorry, "commoners" have no listed proficiencies, and I'm ruling they have no general proficiency in simple weapons. And no peasant will enter your service to fight a dragon without ensuring proper training, let alone if you're going to teach them to use a weapon that can't quite hit the dragon at his range of effect.
AF: But the math clearly shows that...
Me: Math? Peasants can't even read!
AF: Fine. I'll...sell some of my magical gear.
Me: Oooh, yeah, that's gonna take a few months to find a buyer, and you're going to need to travel to the capital to do that. Oh, and don't forget 2000 longbows at 50 gp each is another 100,000 gp. Plus 4,000 gp for arrows and quivers. Training 2,000 men will also require hiring 200 instructors who, at 2 gp per day each, will cost you another 100,000 gp. That's a total of 204,000 gp.
AF: This isn't RAW! You're a dick!
Me: Oh no, we're still entire within RAW still. 2 gp/day is a comfortable lifestyle, and someone skilled enough to instruct new troops and willing to hire himself out will expect a decent living. So currently, the bill is 704,000 gp for your peasant army. The army, of course, will expect to live in something better than their Poor dwellings to make it worth their while, so 1 gp per day for 250 days times 2000 peasants...that's another 500,000 gp. So we're up to 1,204,000 gp to train your peasant army.
AF: BUT I READ IN A BLOG POST FROM 2013 THAT I COULD DO THIS!
Me: And you can! Although I should let you know that the typical treasure hoard at this level has in the neighborhood of 10,000 gp worth of coins and gems and perhaps 2 or 3 magic items.
AF: Ugh. Fine. I just don't want to wait until I'm high level to confront the dragon.
We roleplay out this absolute faggot selling off his most treasured gear to build his peasant army.
Some weeks of game time pass.
Me: It is midnight. Your army camp is slumbering, with a few night watchmen on patrol. It's been another hard day of training, and your men need their rest. You and your night watchmen are surprised by a sudden attack. Roll initiative.
AF: What? Who's attacking us?
Me: A 90' x 90' area of your camp is instantly incinerated, a cone of fire licking up into the night sky.
AF: What the
fuck...?
Me: Ah, apparently, everything you've been doing rather publicly over the last month or so to try and kill Smokey Steve has gotten the attention of none other than...Smokey Steve. End of the first round. Second round, nothing happens.
AF: Well, let's go out there and attack!
Me: It's midnight, and he's well over 30 feet away, so you can't see him or hear him as he glides around.
Over the next few rounds, Smokey Steve proceeds to kill the absolute faggot's entire peasant army.
Me: Ah, well, at least you hadn't spent all that gold yet, right?