Dog keeps peeing and pooping in house

So for about a week now we notice the dog keeps pooping in the room were storing the baby furniture. My friends like hes just a dog he doesnt know any better and i feel like he does know better hes never done it before why now? Do you guys know what i can do?