Answer explained
Why does carbon mainly form covalent compounds?
Carbon has electron arrangement 2,4. Losing four electrons to form C⁴⁺ requires very high energy, while gaining four to form C⁴⁻ is also highly unfavourable for its small nucleus.
It therefore usually completes its outer octet by sharing electrons, forming covalent bonds.