I suppose you mean in OXCE?
There is hierarchy of different faces, we start at top of vanilla 8 variants (4 skin colors * 2 genders).
Image you have 64 soldiers, each one will have one of this variants, this mean you will have 8 soldiers with same face.
Then we define 16 possible faces, this cause that from this 8 soldiers half get new face, rest stay to old one version.
If we expand number possibility, this happens again half of all units get new face type.
This expansion end at around 256 possible variants (including gender versions).
How exactly engine define who gets what? By bit masks, each unit get rolled random number in range from 0 to 63, name it variant.
When engine try show some soldier graphic check if there is any "look" (for specific gender and nationality) in range 32-63,
if is any, game check if variant number match this range then this look is returned.
if there is no available in this range then game "compress" variant look to 31 values (by dropping byte value 32)
after that game check range 16-31 to see if there is any mach, if it is, it return it other wise reduce again max possible value to 15.
This go until value of variant go to zero, then we leave with only 8 possible version from original game.
One of this two descriptions should be readable enough to understand how logic work there.