How do they know the distance so they all line up.
Usually at arms length. Put your arms up horizontally with fist closed, and you should barely be able to skim the ones next to you or in front. After a while you know the correct distance well enough that you don’t really need to use arms. Afterwards, the officer issues “adjust left” (or right), where everyone turns their heads and make sure they’re lined up perfectly.
The only exceptions were some special drill formations which were almost shoulder to shoulder (row), or “sausage in bun” (column)
An arms length. We used to be sorted be height and you put your arm out and shuffle in until just touching with your finger tips. Then arms down and you are at attention and in formation.
A command is given for a right- or left-dress depending on how the commander wants the parade oriented.
🚶🚶🚶🚶
🚶♂️🚶♂️🚶♂️🚶♂️
🚶🚶🚶🚶
🚶♂️🚶♂️🚶♂️🚶♂️
This video is old, but this is how it’s done: Dress Right, Dress
At ‘half arm intervals’ you raise your right arm, fist clenched and adjust your position until your thumb is on the nex guys spine.