No atomic orbital can hold more than two electrons.Electrons have a property called spin. The Pauli exclusion principle states that two electrons can only occupy the same orbital if they have opposite spin. Atomic orbitals with lower energy are filled first.Hund's rule states that atomic orbitals of the same energy fill singly before pairing starts.This is because electrons repel each other and energy is needed to overcome the repulsion so if pairing took place first it would mean a higher energy configuration occurred before a lower one.The order of filling is:
1s 2s 2p 3s 3p 4s 3d 4p 5s 4d 5p
The 4s orbital is filled before the 3d orbital as the 3d orbital has a higher energy than the 4s orbital.
There is one s orbital, three p orbitals (px, py, pz), five d orbitals and seven f orbitals. The maximum number of electrons that can be held in the s,p,d and f orbitals is 2,6,10 and 14.
1s 2s 2p 3s 3p 4s 3d 4p 5s 4d 5p
The 4s orbital is filled before the 3d orbital as the 3d orbital has a higher energy than the 4s orbital.
| 1s 2s 2px 2py 2pz | |||||
| oxygen | ↿⇂ | ↿⇂ | ↿⇂ | ↿ | ↿ |