My husband has pain in his anus and testicles, what is wrong with him?

See his doctor. This sounds like prostatitis, in any case, he should see his doctor as soon as possible.