Dog acting weird the past week. Help?

So I’m 23 weeks pregnant and the last week my dog has been pooping and peeing in the house every single time we leave the house, every single time no matter how long we’re gone. We even take him out before we leave and I made sure he went 1 & 2 before bringing him in, we were gone for 25 minutes and he still went after we just took him out. He is completely house trained and hasn’t had accidents the whole time we have had him. My mom thinks it is because something is upsetting him and it’s possibly my pregnancy as he’s super attached to me. She said it may be because he can smell my hormones more now. Does anyone have an idea if it’s this? Or what may be going on. It just started happening like I said.