Atoms are called "electron-deficient" when they have too few electrons as compared to their respective rules, or "hypervalent" when they have too many electrons. Since these compounds tend to be more reactive than compounds that obey their rule, electron counting is an important tool for identifying the reactivity of molecules.
Two methods of electron counting are popular and both give the same result.
The neutral counting approach assumes the molecule or fragment being studied consists of purely covalent bonds. It was popularized by Malcolm Green along with the L and X ligand notation. It is usually considered easier especially for low-valent transition metals.
The "ionic counting" approach assumes purely ionic bonds between atoms. One can check one's calculation by employing both approaches.
It is important, though, to be aware that most chemical species exist between the purely covalent and ionic extremes.
This method begins with locating the central atom on the periodic table and determining the number of its valence electrons. One counts valence electrons for main group elements differently from transition metals.
E.g. in period 2: B, C, N, O, and F have 3, 4, 5, 6, and 7 valence electrons, respectively.
E.g. in period 4: K, Ca, Sc, Ti, V, Cr, Fe, Ni have 1, 2, 3, 4, 5, 6, 8, 10 valence electrons respectively.
One is added for every halide or other anionic ligand which binds to the central atom through a sigma bond.
Two is added for every lone pair bonding to the metal (e.g. each Lewis base binds with a lone pair). Unsaturated hydrocarbons such as alkenes and alkynes are considered Lewis bases. Similarly Lewis and Bronsted acids (protons) contribute nothing.
One is added for each homoelement bond.
One is added for each negative charge, and one is subtracted for each positive charge.
This method begins by calculating the number of electrons of the element, assuming an oxidation state
E.g. for a Fe2+ has 6 electrons
S2− has 8 electrons
Two is added for every halide or other anionic ligand which binds to the metal through a sigma bond.
Two is added for every lone pair bonding to the metal (e.g. each phosphine ligand can bind with a lone pair). Similarly Lewis and Bronsted acids (protons) contribute nothing.
For unsaturated ligands such as alkenes, one electron is added for each carbon atom binding to the metal.
The numbers of electrons "donated" by some ligands depends on the geometry of the metal-ligand ensemble. An example of this complication is the M–NO entity. When this grouping is linear, the NO ligand is considered to be a three-electron ligand. When the M–NO subunit is strongly bent at N, the NO is treated as a pseudohalide and is thus a one electron (in the neutral counting approach). The situation is not very different from the η3 versus the η1 allyl. Another unusual ligand from the electron counting perspective is sulfur dioxide.
conclusion: ionic counting indicates a molecule lacking lone pairs of electrons, therefore its structure will be octahedral, as predicted by VSEPR. One might conclude that this molecule would be highly reactive - but the opposite is true: SF6 is inert, and it is widely used in industry because of this property.
neutral counting: Fe contributes 8 electrons, the 2 cyclopentadienyl-rings contribute 5 each: 8 + 2 × 5 = 18 electrons
ionic counting: Fe2+ contributes 6 electrons, the two aromatic cyclopentadienyl rings contribute 6 each: 6 + 2 × 6 = 18 valence electrons on iron.
conclusion: Ferrocene is expected to be an isolable compound.
These examples show the methods of electron counting, they are a formalism, and don't have anything to do with real life chemical transformations. Most of the 'fragments' mentioned above do not exist as such; they cannot be kept in a bottle: e.g. the neutral C, the tetra-anionic C, the neutral Ti, and the tetra-cationic Ti are not free species, they are always bound to something, for neutral C, it is commonly found in graphite, charcoal, diamond (sharing electrons with the neighboring carbons), as for Ti which can be found as its metal (where it shares its electrons with neighboring Ti atoms), C4− and Ti4+ 'exist' only with appropriate counterions (with which they probably share electrons). So these formalisms are only used to predict stabilities or properties of compounds!
^Parkin, Gerard (2006). "Valence, Oxidation Number, and Formal Charge: Three Related but Fundamentally Different Concepts". Journal of Chemical Education. 83 (5): 791. Bibcode:2006JChEd..83..791P. doi:10.1021/ed083p791. ISSN 0021-9584. Retrieved 2009-11-10.
^Green, M. L. H. (1995-09-20). "A new approach to the formal classification of covalent compounds of the elements". Journal of Organometallic Chemistry. 500 (1–2): 127–148. doi:10.1016/0022-328X(95)00508-N. ISSN 0022-328X.