Schnauzers are stubborn and require persistance. Pick the spot you want him to use, attach him to you with a leash, and take him there often. Praise profusely when successful.
When home alone and overnight, keep it in a kennel. It won't defecate where it sleeps. Make sure to regularly let it outside and give lots of positive reinforcement.