Just like the previous answers, I'd suggest to dim the lights and give him one of your previously worn shirts to snuggle up to, if you let him hide under a blanket or something he may feel less exposed and more comfortable to bond with you
Also leaving one of your shirts in his cage may familiarize him with your scent. Just make sure you don't wear any strong scented perfume or soaps so that he'll know YOUR scent.
My hedgehog Damien will not come out unless the lights are dimmed and he's able to hide a little under something in my lap, when he feels comfortable he usually stretches and walks about on my lap exploring on his own.
For his poop I would suggest monitoring what your feeding him and that he has plenty of water, he could also just be stressed. If it keeps happening take him to a vet to get him checked for any serious problems.
By the way, sometimes not all hedgehogs like to be pet. Damien doesn't let me pet him, that's just how his personality is but he is still comfortable with me. Some hedgehogs are just like that! Hope this helps