Covalent bonding occurs when atoms share valence electrons to achieve stable electron configurations. Molecules are formed when atoms bond covalently, with molecular formulas indicating the types and numbers of atoms. Lewis structures represent molecules by showing bonding pairs and unshared electron pairs. Exceptions to the octet rule include hydrogen and boron. Resonance structures are used to depict molecules that cannot be represented by a single Lewis structure.