In a noble gas, an atom tends to have 8 electrons in its outer shell. This serves as the model for the octet rule which is mostly applicable to main group elements of the second and third periods. In terms of atomic orbitals, the electrons in the valence shell are distributed 2 in the single s orbital and 2 each in the three p orbitals.
For organometallic compounds containing transition metals, the valence shell consists of electrons in these s and p orbitals, as well as up to 10 additional electrons, distributed as 2 into each of 5 d orbitals, to make a total of 18 electrons in a complete valence shell for such a compound. This is referred to as the eighteen electron rule.