Octet Rule
Discussing the octet rule in the context of electron configuration builds a much stronger understanding of it.
Recall that atoms need 8 valence electrons to become stable. Another way to put it is that they want to fill their outermost s and p subshells. The s-subshell can hold 2 electrons, and the p-subshell can hold 6 electrons, adding up to a total of 8 electrons.
This is why transition metals do not follow the octet rule. They have incomplete d-subshells, so removing electrons works a little bit differently. This also allows transition metals to have multiple ion charges.
The diagrams below show why nitrogen gains three electrons to become stable, while sodium loses one.


Removing Valence
When removing valence electrons, the outermost electrons are removed first. These are the electrons with the highest principal energy level.
So, in Zinc, which has the electron configuration [Ar] 4s² 3d¹⁰, the first electrons to be removed are the 4s electrons. Although 3d electrons are higher energy, they are closer to the nucleus because they are in the third energy level, while the 4s electrons are in the fourth.
Therefore, Zn²⁺ has an electron configuration of [Ar] 3d¹⁰ (it lost its two 4s electrons). The same thing happens for other transition metals.
Exceptions
There are a few exceptions to the normal rules of electron configuration. You likely won’t see them that much, but they’re good to know. These exceptions occur to increase the atom’s stability.
You would expect chromium (Cr) to have an electron configuration of [Ar] 4s² 3d⁴. However it actually has an electron configuration of [Ar] 4s¹ 3d⁵. It moves an electron from 4s to 3d. This causes the 3d subshell to be half-filled, which gives the atom more stability. The same exception occurs for other transition metals in the same group as chromium (Mo, W, Sg).
You would expect copper to have an electron configuration of [Ar] 4s² 3d⁹. However it actually is [Ar] 4s¹ 3d¹⁰. This is similar to the last exception. Copper moves an electron from 4s to 3d, filling the 3d subshell. This is more stable than 4s² 3d⁹. Other transition metals in the same group as copper (Au, Ag) also follow this exception.
