Hitting your kitten will NOT solve the problem. You need to isolate him in a room with his litterbox, food and water for 24-48 hours. He SHOULD get the idea.

When I brought my very first kitty Mollie Rose (now 12 years old) home, she kept pooping behind my livingroom chair. That's what the vet told me to do and it worked like a charm. If you have an upstairs and downstairs, you might want to get another litterbox and put it where he's going.

Has your kitten been to the vet yet?? Might also want to rule out any medical problems.

Good luck and keep us posted.