Do you have a fenced in yard? I have a doggie door, so mine just goes out when she needs or wants to. It sounds like to me you have to start all over from the beginning again. Start taking him out once an hour, through the same door each time, to the same general spot you would like him to use in the yard. You are right in giving him a treat each time he goes outside. Hopefully he will get it in just a few days. When he pees in the house, take him outside immediately. When people come over, tell them to ignore him until he is under control, then they can pet or speak to him. Look at the siblings on this question too. I see that @Dr Dredd has asked a similar question and maybe there is some good advice there.