Why is the iron(II) on the heme molecule depicted as having 6 electrons in its 5 d non- and anti-bonding orbitals? Approximating the $\ce{Fe}$ complex as a square base pyramid ($D_\mathrm{4h}$ symmetry) with 5 $\ce{N}$ ligands, My electron count of the system gives me 16 electrons – 10 from the $2\times 5$ $\ce{N}$ electron pairs and 6 from the iron(II). Filling the molecular orbitals of the valence shells, I ended up with $\ce{4 e-}$ in the d non-bonding orbitals – for there to be 6 in the d orbitals, I am under the impression that there must be 18 electrons, as suggested by the 18 electron rule (which I am aware is a loose guideline).

Looking at depictions of the orbital diagram however, such as this one:



and this one: 



I've seen that there are consistently 6 electrons in these orbitals — which would be consistent with iron(0) but not iron(II) as I understand it. Can anyone help me make sense of this situation?

If I'm being a little unclear about my approximation, just look at the $\ce{Fe}$ molecular orbitals on the lefthand side of the images and subtract 2 electrons
I've seen that there are consistently 6 electrons in these orbitals — which would be consistent with iron(0) but not iron(II) as I understand it.


Iron is in the 8th group (or group VIIIb in older terminology). Thus, in its ground state it has eight electrons; two of which are in the 4s orbital. However, practically always once you oxidise a transition metal and enter coordination chemistry, the orbital energies shift relatively to each other and it becomes more stable to have all the energies in the d-orbitals. Thus, the typical configuration for iron(II) is not $[\ce{Ar}]\,\mathrm{3d^4\,4s^2}$ but $[\ce{Ar}]\,\mathrm{3d^6\,4s^0}$.


  I am under the impression that there must be 18 electrons, as suggested by the 18 electron rule (which I am aware is a loose guideline).


I think, you’re not aware of the looseness of the 18-electron-rule guideline. Most of the time it does nothing except for stating a maximum that can occur. However, there are still many complexes that violate it; e.g. anything octahedral with zinc(II) (22 electrons), anything with copper(II) (21), octahedral nickel(II) (20) etc. It is much more valuable when going to neutral carbonyl complexes; e.g. iron typically forms pentacarbonyliron $\ce{[Fe(CO)5]}$ due to the 18 electron rule. But in the context of standard cationic complexes. you can safely ignore it.