( ( When ( ( two ( oxygen atoms ) ) ( form ( the ( compound O2 ) ) ) ) ) ( , ( they ( ( ( ( share ( ( two pairs ) ( of electrons ) ) ) , ) ( forming ( two ( covalent bonds ) ) ) ) . ) ) ) )
(ROOT (S (SBAR (WHADVP (WRB When)) (S (NP (CD two) (NN oxygen) (NNS atoms)) (VP (VBP form) (NP (DT the) (JJ compound) (NN O2))))) (, ,) (NP (PRP they)) (VP (VBP share) (NP (NP (CD two) (NNS pairs)) (PP (IN of) (NP (NNS electrons)))) (, ,) (S (VP (VBG forming) (NP (CD two) (JJ covalent) (NNS bonds))))) (. .)))
When two oxygen atoms form the compound O2, they share two pairs of electrons, forming two covalent bonds.
(ROOT (S (NP (DT An) (NN ether)) (VP (VBZ is) (NP (NP (DT an) (JJ organic) (NN compound)) (SBAR (WHPP (IN in) (WHNP (WDT which))) (S (NP (CD two) (NN hydrocarbon) (NNS groups)) (VP (VBP are) (VP (VBG bonded) (PP (TO to) (NP (DT the) (JJ same) (NN oxygen) (NN atom))))))))) (. .)))