How to stop my puppy going to the toilet inside when i am at

 
How to stop my puppy going to the toilet inside when i am at work?
My 6 month old puppy is toilet trained, however whenever we leave the house for longer periods of time he will wee and poo inside. He has a doggy door and a 2 year old dog compainion who goes outside but the puppy just wont.
put him outside. Dont worry he will be fine.
Feed the dog where he tends to pee. Dogs hate peeing/pooing where they eat. Also I would work to reinforce his toilet training better before you leave him alone for such a long time.
It takes time for the dog to get used to his/her normal spot to use the pad.
Slap him around that's how we Hispanics train our dogs lol usually when u are around in the house keep a eye on him when he or she is bout to piss or poo yell no go outside open door then he/she does it's business