Hm. So you were 8 weeks 1 day (from the first day of your last period) when you got the ultrasound due date of August 9? That doesn't guarantee you got pregnant on the 16th but it certainly does not rule it out.
All you can do is a DNA test. If the guy who is not your boyfriend had any sperm in his reproductive tract at the time, it could have taken a ride into your body on the pre-ejaculate. At this late date he probably doesn't remember reliably if he had ejaculated recently before having had sex with you, if he even wants to admit it.
You will need to test with both guys to be certain, unless you test with your boyfriend and get a positive. Don't use a drugstore test, go to a lab certified by the family courts in your area of jurisdiction. It is also possible that the hospital can do legally approved paternity testing. You can tell your boyfriend it is needed since you are not married.
I'm sorry there is not a clearer answer.
It would be useful to figure out if you really got pregnant on the 16th. (You might have been pregnant already.) What was the first (not the last) day of your last period? How often do your periods come? Did you have an ultrasound?