Diatomic molecules involve the presence of two atoms chemically bonded with each other.
If the two atoms are identical, it's called a homonuclear diatomic molecule.
If the atoms are different, then it's called a heteronuclear diatomic molecule
Hydrogen and Oxygen
A hydrogen molecule is made up of two hydrogen atoms. Each hydrogen atom has one valence electron and it completes its octet by making a covalent bond with the other hydrogen atom.
A oxygen molecule is made up of two oxygen atoms. Each oxygen atom has six valence electrons and it completes its octet by making a double bond with other oxygen atom.
Therefore, Oxygen and Hydrogen are diatomic molecules.