The best explanation of how two oxygen atoms, each with six valence electrons, can bond with each other is:
Each atom can share two electrons with the other so that each atom has eight valence electrons.
This describes covalent bonding, where the two oxygen atoms share a pair of electrons, allowing both to achieve a full octet (eight valence electrons) and thus stabilize their electronic configuration. In the case of oxygen, this results in a double bond between the two atoms.