Pairs of electrons that are not involved in covalent bonding are called lone pairs.
Dot-and-cross diagrams can be used to show covalent bonding.
Carbon forms 4 bonds as it is in group 4 and needs to share 4 electron to gain the electron configuration of neon. Nitrogen forms 3 bonds and oxygen forms two bonds as they are in group 5 and 6 respectively. Fluorine and hydrogen form 1 bond as only one additional electron is needed.
Period 3 elements have the 3d orbitals available so the third quantum shell can hold up to 18 electrons. More electrons are available for bonding with sulfur, phosphorus and chlorine. Phosphorus can form PF3 and PF5, sulfur can form SF2, SF4 and SF6 and chlorine and fluorine can form ClF, ClF3 and ClF5.
Oxygen (O=O) and carbon dioxide (O=C=O) contain double bonds. Nitrogen N≡N, carbon monoxide C≡O and the cyanide ion C≡N- contains triple bonds.