A Lewis (electron-dot) structure is a two-dimensional diagram that represents the covalent bonding within a molecule or polyatomic ion by explicitly showing every bonding electron pair (typically drawn as a line) and every non-bonding lone pair (typically drawn as a pair of dots) on each atom.
Constructing a Lewis structure follows a short, systematic procedure. First, count the total number of valence electrons available, summing the valence-shell electron count of every atom present and, for a polyatomic ion, adding one electron per unit of negative charge or subtracting one electron per unit of positive charge. Second, choose a reasonable central atom — usually the least electronegative atom present, since hydrogen is never a central atom — and arrange the remaining atoms around it. Third, place a single bonding pair between the central atom and each surrounding atom, and then distribute the remaining electrons as lone pairs, generally starting with the outer atoms, so that every atom (barring recognised exceptions) reaches a complete octet. Fourth, if the central atom is still short of an octet after this, convert one or more lone pairs on the outer atoms into additional shared (bonding) pairs, forming double or triple bonds as required.
Many real molecules and ions can be drawn with more than one Lewis structure that each satisfies the octet rule equally well; when this happens, formal charge is the tool used to judge which structure best represents the actual distribution of charge, or, in the case of species exhibiting resonance, to help identify the set of equivalent, low-energy contributing structures. The formal charge on any atom in a Lewis structure is calculated as:
FC=(valence electrons of the free atom)−(non-bonding electrons on that atom)−21(bonding electrons on that atom)
Formal charge is not the same thing as the actual, real charge on the atom — it is a bookkeeping device that assumes bonding electrons are shared perfectly equally, regardless of electronegativity — but as a rule of thumb, the most realistic Lewis structure for a species is generally the one in which formal charges are as close to zero as possible, and any negative formal charge, where present, sits on the more electronegative atom. Applied to a polyatomic ion, the sum of the formal charges on every atom must always equal the ion's overall charge — a useful, quick check that a proposed Lewis structure has been drawn correctly and that all valence electrons have been properly accounted for.