So I'm doing structural chemistry right now, and a few weeks ago we started on Lewis structures. We learned about how the atoms bond to each other with their valence electrons and form octets and that proper Lewis structures have minimized formal charges. What I don't understand are bonding rules. Now most times one electron from atom A is shared with one electron from atom B to form a single bond. But there are times where two atoms from atom A form a bond between it and some other atom. Why is this?
Example: Oxygen has six valence electrons. When it has a single bond and completes its octet, it has one single bond and six valence electrons. Why is it like this?