You have to check if he is "bloating". It means that his intestines have twisted due to something ate or overactivity after eating. Look it up on the internet, there are demonstrations of how to check and what to do. It is very serious if it is bloat.
I would recommend that you take the dog to a vet to ensure a complete check up to establish the cause of the stomach pains. You should not overlook it but ensure necessary steps are taken to ensure full recovery.