Welcome to HCM.
Intercourse can certainly cause urinary tract infection
(UTI), if your partner is infected.
Prevention is better than cure. Your partner should maintain hygiene, by regularly cleaning his private parts, and it is a good idea to clean it just before you are planning to have sex.
Once infected you will need antibiotic treatment, depending on the infecting organism, which can be detected by culture of urine.
Drinking plenty of water could avoid infection in mild cases.