was the grass wet this morning? or was it cold out? that may sometimes cause them to do this.
also, please do not scold him. negative energy from you will just cause him to hide his mistakes.
instead, gives tons of praise when he goes where you want him to (outside). most of all,
be consistent. if you were walking him, and have stopped, that does shake things up a bit.