99% of the time when I take my dog out to use the bathroom, he'll urinate, but won't defecate, however he will go in the house later.
When you see him going in the house, quickly bring him outside. Reward him when he goes outside (urine or feces). Reprimand him when he goes inside as long as you catch him in the act or it was within 20 min of the act. vetcare