Try out these step they will work but if they don't then buy a book I'll recommend "Cat Training Secret Revealed" first try these steps
step 1- when you see your cat/kitten about to poop pick it up gently and carry to the litter box
step 2- give lots of attention once done the toilet and a treat
step 3- repeat very time until it learns doing the toilet in the box is a good thing
if it dose it anyway ells lightly tap the cat/kitten on the nose and say no
Cat Trainig Video
Cat Training Secret