Most important condition for resonance to occur is that the involved atoms in resonating structures must be coplanar for maximum delocalisation. If bulky groups are present on adjacent atoms planarity of orbitals is inhibited. This is known as steric inhibition of resonance.

In dimethylaniline, the orbital having lone pair of electrons present on nitrogen atom is in the plane of benzene ring hence lone pair takes part in delocalization.
In N, N–dimethyl–2, 6–dinitroaniline, the N(CH3)2 group is out of the plane of benzene ring owing to the presence of two bulky nitro groups so lone pair of electrons on the nitrogen atoms of N(CH3)2 group cannot get delocalized through lone pair, π conjugation.