Two individual hydrogen atoms can be bonded together by a covalent bond. Since each hydrogen atom contains one electron, they can evenly share their electrons and form a strong covalent bond.
When two hydrogen atoms combine, they form a hydrogen molecule, or H2. The electron in each hydrogen atom is shared with the adjacent hydrogen atom. This allows the atoms to each have a completely filled valence electron shield, so they become more stable together than they are apart. As the two atoms bond together and share electrons, energy is released. This release of energy allows the molecule to stay stable.