Taking CH2O as an example, (formaldehyde.) Please note, a basic understand of Chemistry is necessary to fully understand the content of this article.
1. Determine the arrangement of atoms within a molecule.
The central atom in usually the one with lowest electron affinity. In CH2O, the central atom is C (carbon). You will come to recognise that certain atoms often appear as the central atom; among them: C, N, P, and S. The electro-negativity of atoms can also be used to determine the central atom. Halogens are often terminal atoms forming a single bond to one other atom, but they can be the central atom when combined with O in oxo-acids, (e.g. HClO4) Oxygen is the central atom in water, but in conjunction with nitrogen, phosphorous, and the halogens, it is usually a terminal atom. Hydrogen is a terminal atom because it typically bonds to only one other atom.
2. Determine the total number of valence electrons in the molecule or ion.
In a neutral molecule, this number will be the sum of the valence electrons for each atom. For an anion, add the number of electrons equal to the negative charge. For a cation, subtract the number of electrons equal to the positive charge. The number of valence electron pairs will be half the total number of electrons.
Valence electrons = 12 electrons (or 6 electron pairs.)
= 4 for C + (2x1 for the two H atoms) + 6 for Oxygen
3. Place one pair of electrons between each pair of bonded atoms to form a single bond.
Here, three electron pairs are used to make three single bonds. Three electron pairs of the original 6 electron pairs in CH2O are still to be used. (Each red line = 2 electrons = 1 electron pair.)
4. Use any remaining pairs as lone pairs around each terminal atom (except H, as H's outer shell is now full) so that each terminal atom is surrounded by eight electrons.
If after this is done there are electrons left over, assign them to the central atom. (If the central atom is an element in the third or higher period, it can have more than eight electrons.
Here, all original 12 electron pairs have been assigned, but notice that the Carbon atom only has a share in three pairs, where it needs four like Oxygen.
5. If the central atom has fewer than eight electrons at this point, change one or more of the lone pairs on the terminal atoms into a bonding pair between the central and terminal atom to form a multiple bond.
As a general rule, double or triple bonds are most often encountered when both atom are from the following list: C, N, or O. That is, bonds such as C=C, C=N, and C=O will be encountered more frequently.