* Magnesium (Mg): Has three electron shells. Its electronic configuration is 2, 8, 2. This means it has 2 electrons in the first shell, 8 in the second, and 2 in the outermost third shell.
* Sulfur (S): Has three electron shells as well. Its electronic configuration is 2, 8, 6. It has 2 electrons in the first shell, 8 in the second, and 6 in the outermost third shell.
Therefore, both magnesium and sulfur have the same number of electron shells (three). The difference lies in the number of electrons in their outermost shell. This is why they have different chemical properties.