The octet rule is the understanding that most atoms seek to gain stability in their outer most energy level by filling the s and p orbitals of the highest energy level with eight electrons.
Nitrogen has an electron configuration of 1s²2s²2p³ this means that nitrogen has five valence electrons 2s²2p³ .
Nitrogen seeks out three additional electrons to fill the p orbital and gain the stability of a noble gas, 1s²2s²2p⁶ .
However, now nitrogen has 10 electrons and only 7 protons making it a -3 charge anion
N−³.