For atoms in the 4th period, the 3d electrons count as valence electrons. Similarly, for atoms in the 5th period, 4d electrons count as valence electrons. In general, electrons in the (n-1)d and (n-2)f orbitals count as valence electrons and should be shown on the electron configuration.