Answer: The Pauli Exclusion Principle
Step-by-step explanation:
The electrons are filled in orbitals of equal energy with one electron entering each orbital until all the orbitals contain one electron with the same spin. The pairing of electrons take place thereafter.
The first electron in an orbital could have +1/2 spin or -1/2 spin. All of the electrons in singly occupied orbitals have the same spin so as to maximize total spin. which is given by Hunds rule.
Two electrons must have opposite spin and thus different spin quantum numbers is given by Pauli's exclusion principle.