The valency of an element is the number of electrons it gain or lose to complete its octet.
Metals lose electrons and non-metals gain electron. Calcium is a metal.
Electronic configuration of Calcium is
The calcium element has 2 valence electrons, and to fulfill its octet it will lose electrons and it easier to lose 2 electrons rather than accepting 6 electrons.