Aniline contains an amino group (-NH₂), which is an electron-donating group. The electron-donating nature of -NH₂ directs the incoming electrophile (NO₂) to the ortho and para positions on the benzene ring.
However, the amino group also makes the ring somewhat more reactive, which leads to the formation of meta products in some cases due to steric hindrance and the electrophilic nature of the nitronium ion (NO₂⁺). The meta product is formed due to the weaker activation at the meta position compared to ortho and para positions.