It sounds like he is rebelling against being shut up. That's too bad. I can understand it. Have you tried bitter apple spray? I suppose taje has the best idea. I have never had to shut mine up like that because someone is there and I know it has to be hard to do it. I'm sorry I can't suggest anything else. Is there a room where you could put him that isn't carpeted that has windows? Looking out seems to be their favorite pastime. At least, that is my experience.