Dog acting weird!!

Tassia
I'm almost 37 weeks, and my dog have been very good about the whole pregnancy. He have been very protective over me. When I traveled for the weekend without him he was depressed the whole time I was gone. Now we've been back for a week and I've notice in two different random nights he have been getting out of our bed in the middle of the night, and sleeping on the carpet. And he always sleeps with us. I also caught him peeing on the baby room once. My main thing is why does he keeps getting out of our bed in the middle of the night and sleeping on the floor?