Yes. Anal sex is a high risk activity in terms of HIV. Sexually, receptive anal sex is the highest risk for acquiring HIV from a positive partner, with insertie anal sex right after it.
Odds can be thrown around....chances are fairly low he was actually infected, and one exposure does not always equal infection. It can happen the 1st time, or after hundreds of times if he was even positive.
Yup, you guessed it....just go for a test. If the "few months ago" means 3 months or 12 weeks, any modern test would be 100% conclusive. Just go for a rapid test, they take 10 minutes for the results to return. You had a risk, but even then the odds are still very much on your side. Relax, and just get tested. Please learn from this and protect yourself in the future