UTI. After sex

Ive had sex

twice using the pull out method with my boyfriend. I got a uti from eacth time. I pee right afterwards and i washed afterwards as well. What am i doing wrong? How can i avoid it.