My Jack Russell does that. He either wants to get out or is nervous.
Dogs do such activities when when they have separation anxiety and are nervous. They can also scratch walls when getting bored.
You should not leave your dog alone. Try to spend time with him. Take him on walks or exercise him regularly. Bring some toys for him to play with.
You should not leave your dog alone. Try to spend time with him. Take him on walks or exercise him regularly. Bring some toys for him to play with.