An Oxygen atom has 2 unpaired electrons in it's uppermost occupied molecular orbitals and will form 2 bonds with it. Halogens have only 1 unpaired electron, hence will form 1 bond. Hydrogen has only 1 electron, hence the single bond.
That's why Oxygen can exist as Ozon, even though the O2 with a double bond between the atoms is more stable. (Ozon has 1 delocalized bond)