Pregnant and scared

Ok so this is mostly me being an anxious mess but I have to ask, can sperm live in you and impregnate after bleeding and getting a period over the course of two months? I ask because my husband and I separated and I was with guy B about 3 months ago. Since that time I got back with my husband and only slept with him. I had also had a period since being with guy B, and just last week found out I was pregnant. I was only with my husband since mid January, when we got back together so it has to be his right??? I was measured at about 5 weeks last week if it matters