Your last period started on 2 July? How long is your cycle?
No one, not even your doctor, can tell you when you conceived. It is not immediate and it varies in all women.
You normally will ovulate sometime between days 11 and 16 of your cycle (assuming 28 days).
You had sex with your husband on days 2,3 and 4 and had sex with your ex on day 7. Sperm can survive UP TO about 5 days at most.
Did you have sex any other time during the month and with whom?
From what you post, it is VERY UNLIKELY that your husband is the father, it was just too early in your cycle. There is a GOOD CHANCE your ex is the father as the timing works.
You will need a DNA test to confirm paternity. It can be done, non-invasively, as early as 9 weeks gestation.
You'll need a DNA test to confirm but it does appear your ex is the father.