A stomach ache is a very serious sign of illness in a dog. Please take this animal to a vet.
Human medicine should NOT be given to a dog.
Our dogs were outside dogs and they ate grass when they needed to relieve their stomachs. Alternatively, they might eat vegetables that you have cooked and cooled in the microwave.