It depends on why he is doing it. If he is bored,you'll just need to give him some more excersise. he may be trying to get your attention. A basic why to start would be when ever he starts digging take him out of the room, either outside or the bathroom, wait 2-3 mins then bring him back in. Repeat.