Alkaline earth metals show:
Zero valency
Variable valency
Monovalency
Divalency
Since the outermost orbital contain only two electrons, alkaline earth metals show divalency by losing these two electrons.
Due to the loss of the following electrons, transition metal shows variable valency: