Here's why:
* Electron Configuration: Magnesium's electron configuration is 1s² 2s² 2p⁶ 3s².
* Valence Electrons: Valence electrons are the electrons in the outermost energy level of an atom. For magnesium, this is the 3rd energy level (n=3), which contains the 2 electrons in the 3s orbital.