My daughter did this and it took a few months for her to go on the toilet. I would ignore it for now and don't tell the child off or try and force him to use the potty. It will only make it a bigger issue and frighten him. This is much more common than you think and he will grow out of it. My daughter did it all the time and I did tell her off at first but it made no difference. A few months later she actually told me she needed to poo and I was really busy at the time and just told her to go to the toilet herself. To my amazement because I left her to it she did! She got lots of praise and never did it in her pants again!
He will get over this, not many 18yr olds still poo in their pants do they!?