With the SCW event are the units that will flip to the Nationalists hard coded? Is the leader, the location or just RNG?
A few things happen.
1. The country, Nationalist Spain (SPA), is created and given cores on everything just like Republican Spain (SPR).
2. SPR's armed forces are split, with roughly 55% of them going over to the nationalists.
3. Certain specific territories amounting to roughly half the nation go into the control of SPA, though if they have units in them that end up remaining loyal to SPR, they will be immediately reconquered back of course, though they may remain isolated and out of supply that way. Which territories go to SPA is preset in the SCW event chain to roughly match those which initially sided with the nationalists. So while they are not "hard-coded" in the way we normally use that term here, meaning unable to be modded, they
are predetermined and will be the same every time unless you edit the event file.
4. A few brand new infantry units are created out of thin air in specific provinces which are set to go to SPR. These are also predetermined in the event file, so they are moddable but not random.
Also what happens if you group the entire armed forces in a single province before the civil war starts?
When the forces are split in step 2 above, the ones which go to the nationalists are teleported to a neighboring province. And since they will slightly outnumber the Republican's forces (SPA gets 55% of them, remember) they will likely go on the attack fairly promptly or try to split up to contain the SPR forces, depending on where it happens and on the types and numbers of units involved.
And finally why does FTH not let me choose a side?
Sebas hit how to resolve it. Why it happens is simply that when launching a scenario or compaign you cannot choose to play a country that doesn't exist at the time. So they put in easy switching mechanisms to let the player handle it how they like, giving them the ability to start a campaign from before their desired nation has been created so they can get things rolling in the desired way then switch to the target country once it exists.