Oxidation state of an element depends upon the electrons present in the outermost shell or eight minus the number of valence shell electrons (outermost shell electrons). e.g.,
Alkali metals (Group 1 elements) General valence shell electronic configuration -ns1; Oxidation state=+1
Alkaline earth metals (Group 2 elements) General valence shell electronic configuration -ns2; Oxidation state=+2.
Alkali metals and alkaline earth metals belong to s-block elements and elements of group 13 to group 18 are known as p-block elements.
Group 13 elements General valence shell electronic configuration -ns2np1; Oxidation states=+3 and +1.
Group 14 elements General valence shell electronic configuration -ns2np2; Oxidation states=+4 and +2.
Group 15 elements General valence shell electronic configuration -ns2np3; Oxidation states=-3, +3 and +5. Nitrogen shows +1, +2, +4 oxidation states also.
Group 16 elements General valence shell electronic configuration -ns2np4; Oxidation states=-2, +2, +4 and +6.
Group 17 elements General valence shell electronic configuration -ns2np5; Oxidation states=-1, Cl, Br and I also shows +1, +3, +5 and +7 oxidation states.
Group 18 elements General valence shell configuration -ns2np6. Oxidation state=zero.
Transition elements or d-block elements General electronic configuration -(n-1)d1-10ns1-2. These elements show variable oxidation states due to involvement of not only ns electrons but d or f-electrons (inner-transition elements) as well. Their most common oxidation states are +2 and +3.