Unfortunately for easy answers, it sounds like you conceived around August 1, and both guys' sperm was (or could have been) alive in your system at that time. Withdrawal is not really a method of birth control, a guy can have viable sperm in his urethra that gets carried into the woman's body in his pre-ejaculatory fluid. Your boyfriend who had lots of sex with you prior to August 1 might have a slightly better chance, but it only takes one sperm to reach the egg.
You need to do a DNA test with both guys. Contact the family courts in your area of jurisdiction and get a list of labs approved for doing DNA tests for purposes of proving paternity. No point wasting the money on a drugstore test; you are going to need a legitimate answer for child-support purposes.
It could be either guy. When were you first told a due date, and was it determined by an early ultrasound?