The Third period becomes stable with 8 electrons.
The entire third shell includes the 3d electrons.
The 3d electrons are filled in the fourth period. The 4s start to fill with electrons before the 3d. The simple spherical pattern of electron density for the 4s requires less energy that the complex 8 looped 3d pattern of electron density. However as the 3d orbitals fill because the 3d is closer to the nucleus the 3ds become more stable and become part of the third energy level.