Omg I couldn't even finish reading this!! I always watch mine when he plays on the floor and I make sure it's been vacuumed and the bathroom doors are shut and all that, but good lord, no I will never leave him unattended on the floor or let him live outside of his pen. He's just smart and doesn't want to poop in his bath or his pen but will gladly poop on my carpet haha
I am not 100 percent certain, but the way they learn doesn't lead to them being potty trained, like dogs, or cats. A tortoise really does poop when ever it feels like it.
His pooping on your carpet is a sign that he is stressed. I would encourage you to do more research on this. Letting your tortoise roam the house is not good for him.