I am afraid you have received a LOT of awful advice. Most of the awful ones I can tell are facetious... some I am not so sure about.
Yelling at the cat is about the very BEST thing you can do to make the problem worse.
I have written a very in depth article on litter boxes & problems. Send me a real email addy & I'll drop a copy to you.
Basically, a cat that is pooping on the floor is usually telling you that there is
something about the box or litter that he hates. It very well could be medical, but more often pooping in inappropriate places is the cat's only way to lodge a protest against the box.
If you chase him away from the corner he is pooping in now
without resolving his complaint about the box, he will just find another place to go... like your pillow or favorite pair of shoes.
"All" you have to do is learn to think like a cat & solve the problem!