The presence of three unpaired in Nitrogen can be explained by Hund rule. Since the outermost shell is the P shell and P shell has 3 orbitals each of these orbitals can accommodate 2 electron. Then each of these 3 electron occupies one orbital and remain unpaired.