THANK YOU FOR YOUR INPUT.. AND YES IT IS A BETTER THING TO FIND OUT NOW..
Hi there. He is probably stressed. Have you asked him if something is bothering him or if he is scared of something? Also, it won't hurt for you to take him to a child psychologist. Rocking can be a form of OCD but it may also be something else and a child psychologist can get to the bottom of it. Most 5 year olds want to go outside and play with friends and because he doesn't, I think that is another reason to see the psychologist. It is better to find out what is going on at a young age so that you can work with him rather than let something simmer for a long time and just get progressively worse.
Take care and let me know how he is doing.