Electron configuration

The region of the periodic table in which the transition metals are found is known as d-block because proceeding across each row each successive element has an additional d-electron.  The lowest energy electron configurations for the first row transition metals is shown below.

 
Group number3456
atomic number
element symbol
21
Sc
22
Ti
23
V
24
Cr
electron config3d14s23d24s23d34s23d54s1
789101112
25
Mn
26
Fe
27
Co
28
Ni
29
Cu
30
Zn
3d54s23d64s23d74s23d84s23d104s13d104s2


For the transition metal atoms, the total number of valence electrons equals the number of the column (group) in the periodic table (counting from the left).

For transition metal ions having charge ≥ +2,
the 4s orbitals are not occupied 
the number of electrons in the 3d subshell equals the total number of valence electrons (the Group number minus the charge on the ion).

This is because
orbitals in the 3d and 4s subshells are of similar energy.
In transition metal atoms  the 4s subshell is of lower energy than the 3d subshell.
In transition metal ions of charge ≥ +2, 3d is of lower energy than 4s.
In transition metal ions of charge ≥ +2, all valence electrons in the d-subshell.

Therefore
Ni (Group 10) has 10 valence electrons and Ni2+ is d8
Fe (Group 8) has 8 valence electrons and Fe3+ is d5
Ti (Group 4) has 4 valence electrons and Ti3+ is d1