This is an excellent booklet to check out all about litterbox stuff. He's trying to communicate something to you. It's possible the location of the litter box is not to his liking (eg, he doesn't feel safe), or he doesn't like the litter (scented litter is a no-go for a lot of cats). Some cats like one litter type for peeing and another for pooping. Other times, the depth of the litter is a factor (too deep = unsafe feeling). There can be a lot of trial an error to identify the issue!