Step-by-step explanation:
Atomic number of calcium is 20 and its electronic configuration is 2, 8, 8, 2. So, to acquire stability it loses 2 valence electrons and hence forms
ion.
Whereas atomic number of oxygen is 8 and its electronic distribution is 2, 6. And, to attain stability its needs to gain two more electrons and hence then it forms
ion.
Therefore, when both calcium and oxygen chemically combine together then calcium atom will donate its 2 valence electrons to the oxygen atom.
Hence, they will form calcium oxide, that is, CaO.