If he is only 8 weeks old you must not have him for long, so maybe he has not learned yet that the crate is his safe space. I am sure that there are plenty of information here on crate training - maybe you just need to train him more (treats in the crate, fed him in the crate, etc)? Is the crate in a quiet spot, is it close or far from you? Does he go outside alone? Maybe the spot outside is similar to something he was use to. If you just got him, maybe you also just need to spend some more time together to bond. RE the pee, it sounds like he associates the carpet with the pee spot. Have you cleaned up with those specific spray that remove the smell of doggie pee? Otherwise he may be tempted to keep using this spot as a bathroom, because to him it smells like it. He is not doing it on purpose. Just try to be consistent with toilet training, take him to the pee spot (possibly the same spot, ideally a quiet spot - I found that my puppy would get distracted or spooked sometimes) after a drink, play, and every 2 hours and tell him to go potty or whatever you want to use as command, don't play or give him attention until he pees/poo and when he does praise him a LOT! And repeat repeat. These are my 2 cents as another puppy owner! Good luck