All atoms have a specific electronegativity, which means that all atoms have a specific "amount" of ability to attract electrons to themselves from OTHER neighbooring atoms in the molecule!
For example, HF (hydrofluoric acid) is a molecule, that contains two atoms: a hydrogren atom, and a fluorine atom. Hydrogen's specific electronegativity is 2.2, and fluorine's specific electronegativity is 4.0 ...which is the highest electronegativity that any atom has! So, since fluorine is more electronegative than hydrogen, the electrons in the H-F bond will be attracted to, and closer to the fluorine atom! Hence, the HF molecule is polar (the atoms in the molecule have a difference in electronegativity!)
N2 is basically two nitrogen atoms with a single bond between them like this: N-N
A nitrogen atom has a specific electronegativity. But N2 is a NONpolar molecule because the two nitrogen atoms have the same electronegativity! There is no difference in electronegativity! So, N2 molecule is nonpolar!