Yes from your dates I would say its your boyfriends baby. You got your cycle after sex with the the guy and he didn't finish inside of you so you're in the clear. But you also had to have sex with boyfriend other dates than just the just a few days after the 9th.. But either way you're in the clear from the mystery guy, Lol.... Congrats on becoming a mommy
If you had sex August 2 without ejaculation and then had your period after that, and then conceived on August 21, you didn't get pregnant from the guy on August 2. Don't worry.