Hydrogen atom has only one electron and thus, to achieve stable inert gas configuration of helium, it shares its single electron with electron of another hydrogen atom to form a stable diatomic molecule. The stability of H2 is further confirmed by the fact, that formation of one mole of gaseous H2 molecules results in the release of 435.8 kJ of energy.
H(g) + H(g) H2 (g); ∆H = – 435.8 kJ mol-1