I'm not sure he knows it is a problem. It is likely he is pooing in the corner or behind things because it is the closest thing to a box without being the box.
Cats usually go outside the box because they associate the box with something negative. It could be that it hurts him to poo or he had a bad fright while in the box. Or he doesn't like the type of litter you are using. Some cats hate scented litter, for example, and some hate if the litter box is in a room where there is a lot of perfume or air freshener to get rid of the poo smell.
Or if you have another cat or pet, that pet could be bothering him while in the box. Or the box could be located near a loud noise or area that has too much traffic and he feels unsafe. Or he used to have an infection but he doesn't anymore, but he still associates the box with the pain.
So think about the litter box and its location and all these variables, and try to watch him when he has to go to the bathroom. He will probably have to go after sleeping, just like people do, so you might want to get him first thing in the morning or after a long nap, and just observe what is happening. If he does go to the box, does he cry while he is in there? Are his poos soft? Does he run out of the box after using it?
You might try moving the box just to see if it changes his mind about using it.
Also, what is he doing about urination? Do you see him pee in the box, but not poo?
In the area of litter, a great litter is Cat Attract and it is widely endorsed on this site by people who have used it for their kitties who have elimination problems, so you might try that.
It would be good for you to take him to the vet first and rule out anything medical.
Let us know if there is anything you can think of, on or off this list, that might apply, or if there have been any other changes that could be stressing him out.