Getting HPV from oral sex is lower risk than vaginal or anal sex, so I wouldn't overly worry about that, and while you can get HPV from direct skin to skin contact, like his penis rubbing against your anus, a lot depends on how much friction there was, how long the contact was, etc.
There have been several studies on the effectiveness of 2 doses of the HPV vaccine, and it does offer significant protection, but not full protection.
This is mostly about women and cervical cancer, but you'll get the idea that 2 doses does offer a lot of protection - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4964672/
https://www.fredhutch.org/en/news/center-news/2014/08/hpv-cancer-vaccine-are-two-doses-as-good-as-three.html
Talk to your doctor and see if you can still get the 3rd dose, but I wouldn't overly worry about this encounter. Your 2 doses of the vaccine will offer you a good deal of protection.