I’m not sure he does know he’s done wrong, just that when you come back he often gets told off?
It does sound like it’s scent marking
Have you tried one of those posts or sprays for outside to encourage them where to go?
You could also start introducing a toilet command
And instead of just praise treat him as well, make it really worth his time to go outside and pee
I would personally crate train him at this point, he’s unlikely to pee where he is sleeping, so he can’t continue to practice the habit.
Also make sure you have a good enzyme cleaner, not just any cleaner, and scrub 2 or 3 times in any area he goes in the house.
When he’s not in the crate have him on a house line and you need to figure out his tells.
If you’re getting to a point where he stops going in the kitchen, you need to keep him in the kitchen still, for at least a week or so, reinforcing that he doesn’t go in the house.
Then take him into one other room for short periods, supervised, then back into the kitchen
He may be overwhelmed by too much space and trying to secure himself by making it small familiar, so you need to build up to it