As protons are added to the nucleus one by one, electrons are added to hydrongen like orbitals one by one. e^- are added systematically from lowest energy to highest energy orbitals.
The lowest energy configuration of an atom is where as many electrons remain unpaired as possible in the electron configuration.
Paulie Exclusion Principle
No two electrons can have the same four quantum numbers
Heisenberg Uncertainty Principle
The electron is a particle and a wave. We cannot know its speed and position at the same time