carbon has 4 electrons in the outer shell, it can shares electrons. So ,it forms neither stable cation like many metals, nor stable anions, like many non metals.
Why carbon forms neither cations nor anions?
The valence electrons of Carbon atom is 4 (Group IVA) . Thus, it is not possible to remove 4 electrons or accept 4 electrons from a carbon atom to give it the inert gas electron arrangement.
So, it can not behave like an cation ,as metals, it cannot form C4+ cation because of removal of 4 elections from a carbon atom would require a large amount of energy.
Also, carbon cannot form C4- anion because it would be difficult for the nucleus with 6 protons to hold on to 10 electrons. So it can not behave like anions, as non-metals.
Hence carbon atoms share electrons forming covalent compounds.
learn more about carbon properties here :
https://brainly.com/question/2109654
#SPJ4