OHHNHHHCHHHHOCONNwaterammoniamethanecarbon dioxidenitrogenbonds per atom: H 1 · O 2 · N 3 · C 4
Each line is a shared pair of electrons, and each pair of dots is a lone pair that belongs to one atom. Count the electrons around any atom other than hydrogen, two per line and two per pair of dots, and you get 8: a full outer shell. Hydrogen gets 2, which fills its first shell. Oxygen starts with 6 outer electrons and needs 2 more, so it makes 2 bonds. Nitrogen makes 3 and carbon makes 4, using double and triple bonds when there aren't enough partners.