Well, about huts.
If you have 1 city (or, more precisely, you had 1 city in the beggining of your turn): 3 units: north, west, south-east
If you have 2 cities: 4 units: north, east, south, west
If you have 3 cities or more: 8 units: every square
If unit can't spawn (ocean, enemy unit) it will not, so in reality sometimes there are 0,1,2,5,6 or 7 units spawned.
Usualy they all are cavalry.
I tried to understand conditions for legions, but just gave up. It have something to do with current random seed - you can enter in city etc. for differet results. But in some save files there is always zero legions, no matter what.
I'v never seen more than 2 legions from a hut: 0, 1 or 2 (more rare?) out of 3 units, 0, 1 or 2 (more rare?) out of 4 units - never in front of each other(n and s or w and e), but maybe it's just an coincidence, and 0 or 1 out of 8 (I guess 2 out of 8 is a thing, I just never saw it). Maybe it can be more than 2, but extremely rare.
I'm porting Civ1 to Sega Genesis, so I'm interested too, but I still have no idea about legions.
As usual, sorry for some incorrect grammar.