The way that two H2 atoms bond is when their electrons are attracted to the proton of the other atom. This is due to there being a strong enough attraction between atoms, which makes room for electrons in the outer energy level of both atoms, forcing the atoms to share electrons. This ultimately forms a covalent bond.
I hope this helps!