For those elements belongs to period 1 and 2, such as N, the elements have only two orbitals, hence the maximum number of electron accommodated by the elements are only 8 electrons, not more than that. These elements will generally follow the octet rules.
However, for elements that have more than 2 orbitals, they may (not necessarily)expand their valency to the d orbital, which means they can accommodate more than 8 electrons. Eg. PCl5 If you found that the central atom accommodate more than 8 valence electron, then the compound doesn't follow the octet rule, and has too many electrons.
XeF4 certainly has more than 8 valence electron, as there are 12 electrons. (Xe shares 4 electron pair with 4F)