Take him back to the vet.

Try crate training.

Install a doggie door.