According to epidemiological guidelines, individuals should get tested if they have been exposed to risk factors for HIV, such as unprotected sex, sharing needles, or having another sexually transmitted infection (STI). Routine testing is recommended for sexually active individuals, pregnant women, and those with high-risk behaviors.