the atomic number of hydrogen is1.
it needs to have two electronic in its outer shrll, and so if it bonds with another hydrogen atom and they both shere their electron with each other,it has the effect of allowing both atoms to have a complete outer shell