Calcium has an atomic number 20. This means that calcium has 20 electrons.
The electronic configuration of these 20 electrons is as follows: 2,8,8,2
For the calcium to become stable, it should have eight electrons in its outermost energy level.
Based on this, calcium loses two electrons to form an ion and become stable.