Get him to a vet immediately. It sounds like he has severe abdominal pain. This is not something you should watch at home.
Please take him to a vet. It is sometimes a couple of days before you will get an answer here, because this is not a forum for emergency problems.
Peekawho was right about you taking your dog to the vet ASAP. Please let us know the outcome!