How does oxygen and hydrogen form a bond?
By sharing electrons. This forms a covalent bond between the oxygen and hydrogen atoms .
If you look at the periodic table you will see that hydrogen is in the first group meaning it has 1 valence electron (1 electron in its out shell). Oxygen is in the sixth group and has 6 valence electrons.
Since elements like to have a full shell of electrons (this makes them stable) hydrogen wants to gain 1 electron and oxygen wants to gain 2 electrons. This is done by 2 hydrogen sharing their electron with 1 oxygen (the oxygen gains 2 electrons) and the 1 oxygen sharing 2 of its electrons with 2 hydrogen atom (each hydrogen gains 1 electron). So in water that is make of hydrogen and water this ratio of 2 hydrogens for every oxygen is written as