Water is not a compound formed by sharing nitrogen. Water is a compound formed by sharing hydrogen and oxygen. The chemical formula for water is H2O, which indicates that a water molecule consists of two hydrogen atoms and one oxygen atom. These atoms are held together by covalent bonds, in which electrons are shared between the atoms.