Basically, the arrangement of electrons in electronic configuration follows three principles:
1. Aufbau Principle
You start from the highest energy level to the lowest. The arrangement is: 1s<2s<2p<3s<3p<4s<3d<4p<5s<4d<5p<6s<4f<5d<6p<7s<5f<6d<7p.
2. Hund's Rule
Each box in the configuration can hold up to 2 electrons. This rule tells you to fill all boxes of one particular subshell with 1 electron first, before double occupying them.
3. Pauli's Exclusion Principle
This rule tells you that the two electrons in a box shall always have opposite spins, represented by one half-arrow up and one half-arrow down.