Not sure if i can help but has your pups routine changed at all recently to maybe stress him out a little? also when you say he waits till he gets home, do you take him away from your house/garden to have a pee etc?
On the one hand it sounds as if he's doing it when you go out of the room because he stressed and doesn't want you to know it's him (if he does it when your not there you can't know its him sort of thing

)
On the other it sounds as if somthing has stressed him and he doesn't feel secure going to the toilet anywhere else other than your home.