Formation of hydrogen molecules

Hydrogen atom has one valency. To become stable with hydrogen atom, it needs one more electron, When 2 hydrogen atoms join, they share their electrons, on which, the share becomes 2 electrons, which is now a noble gas configuration, being shared between these 2 atoms.

H – H single bond [they share an electron pair (2 electrons)].