I definitely think you should take him to the vet. Vomiting whte foam CAN be a symptom of bloat (which is a serious medical emergency) -since he has had this for 3 days, it doesn't quite sound like bloat, as bloat comes on very suddenly and can literally kill within the hour!
But it's probably more likely he has a bad tummy upset. Drinking a lot and peeing a lot could also be a symptom of a few problems, from kidney troubles to diabetes, and a number of other things. It might be a wise move to get his bloodwork done, to be on the safe side. Many problems, if caught early can be treated successfully.
take him to the vet and tell them to test for parvo virus my dog was about 2 years old and had all his shots and still got it i was told there are two kinds now