Electrons occupy orbitalsof the lowest energy available.
No two electrons in the same atom may have all four quantum numbers alike. This means there are the maximum of 2 electrons in one orbital.
In a group of orbitalsof identical energy i.e. in the same subshell, electrons enter empty orbitalswhenever possible. Electrons in half-filled orbitalshave parallel spins