Try a litterbox with leaves and dirt, to start. Or pine needles and dirt (the pine sort of neutralizes their pee and doesn't smell as bad). Or maybe sand (didn't catch where you're from to guess what he's used to). He would probably rather go there than your carpet! Then you can gradually add litter and take away nature as he gets used to it.

Both of mine were strays/wild at one point. They can be remarkably picky about cat food after living from dumpsters or what not, but he'll eventually be hungry enough to eat. Maybe try putting his food where he won't feel as vulnerable - near a corner, but far enough out so he can sit behind the bowl and watch outward.

Thanks for taking him in! Good luck!