Each hydrogen atom has only one electron in its outermost shell. Therefore, each hydrogen atom required one more electron to achieve the stable configuration of helium (nearest noble gas). The oxygen atom has the electronic configuration 2,6 and has six electrons in its outermost shell. It needs two electrons to complete its octet. Therefore, one atom of oxygen shares its electrons with two hydrogen atoms.