The order in which electrons are removed from an atom is related to the order in which electrons fill orbitals, although it's not always the opposite order. The order is that which results in the maximum stability. Electrons are assigned to orbitals according to these rules:
- Aufbau Principle - electrons fill the lowest available energy levels first.
- Hund's Rule - electrons fill unoccupied orbitals of a given sub-level before any electrons go into an already occupied orbital.
- Pauli Exclusion Principle - a maximum of two electrons can occupy an orbital, and they must have opposite spin. (Spin is an electromagnetic property.)
The diagram below shows how an oxygen atom's eight valence electrons occupy the 2s and 2p orbitals. Since there are four electrons in the p sub-level two must share an orbital. The three p-orbitals are designated Px, Py and Pz with the value Px assigned to the lowest energy of the three. The fourth electron to occupy the 2p sub-level will share the 2px orbital. This is the first electron to be lost by oxygen because that leaves the remaining three 2p electrons in singly-occupied orbitals. This electron is the least stable because electrons in the same orbital repel each other.