Carbon forms a covalent bond. Such a bond occurs between two or more atoms of non-metals when they share electrons between them so that each atom has a full configuration of eight valence electrons.
Carbon, which is in Group 4 of the Periodic Table, has four valence electrons. Carbon atoms can form single, double or triple bonds with other atoms. For example, a carbon atom bonds with two hydrogen atoms, forming two double covalent bonds in carbon dioxide gas. The bonding of hydrogen and carbon atoms creates various compounds called hydrocarbons. Ethane is an example where carbon atoms form single covalent bonds. Ethyne is an example where carbon atoms form triple covalent bonds.