Thank you for the opportunity to help you with your question!
You are thinking of ionic bonds where one element (like calcium )
loses electrons while another (say chlorine) gains it. This is the
extreme. There are also covalent bonding where sharing of electrons
takes place (although the sharing may not be equal). Here, as with
most carbon compounds, there is sharing between calcium and carbon.
There are two single bonds that calcium makes with each carbon atom
and two double bonds that the two carbons make with each other,
completing the octet.
Please let me know if you need any clarification. I'm always happy to answer your questions.