They are completely random.
I got 3 sniper once and in the next mission 3 supports... I think that my game just like to troll me...
From wiki:
A Rookie is a fresh Soldier who lacks a class. After going out onto
missions and gaining a small amount of experience (approximately one
kills worth), they receive the Squaddie rank and are randomly given
one of the four classes: Assault, Heavy, Sniper, or Support
Rookie promotion is slightly weighted toward classes you have less of,
but promotion is otherwise completely random.
Rookie promotion is slightly weighted toward classes you have less of,
but promotion is otherwise completely random.
Rookie promotion is slightly weighted toward classes you have less of,
but promotion is otherwise completely random.
Rookie promotion is slightly weighted toward classes you have less of,
but promotion is otherwise completely random.
Soldiers belonging to any of the principle four classes can access the
abilities of this sub-class in addition to the abilities they already
own, however these psi-abilities only unlock for soldiers who possess
"The Gift" which is determined by testing in the Psionic Labs.