Hello, my name is***** and I have over 20 years of experience as a veterinarian.
I am sorry that your fellow is gagging, retching, licking and has vomited a couple times.
It sounds like he is very nauseous.
Causes of vomiting/nausea include bacterial, viral or fungal infections, eating something he should not including a foreign body (fatty table scraps, bones, or toy piece) or inflammatory bowel disease. Other possibilities are internal organ (kidney or liver) disease that cause a build up of waste products which the organs normally remove that can irritate the gastrointestinal tract, or pancreatitis. Infiltrative cancers like lymphoma are possible as well. At his age organ failure and cancer are very unlikely, but I mention them to be complete. In young dogs vomiting and nausea are usually due to a viral or bacterial infection, (especially in puppies that haven't finished their vaccines), or eating something that they should not have (toy pieces or too many table scraps).
Does he have a fever (rectal temperature greater then 103F)?
I would start with an acid reducing medication to try and settle his stomach. You can give either:
1)Pepcid ac (famotidine) at a dose one 10mg tablet per 20 to 40 pounds of body weight every 12 hours
2)Prilosec (omeprazole) at a dose of one 20mg tablet per 40 to 80 pounds of body weight every 24 hours.
These are acid reducers which will decrease irritation of the stomach and esophagus and may help him feel better. They can be used for several days if need be.
Then I recommend a 12 to 24 hour food fast. Water is fine as he needs to stay hydrated but by taking away food we rest his gut and hopefully reset normal gut motions.
In 12 to 24 hours if he isn't vomiting or retching anymore start a bland diet of 1/3 boiled, skinless, white meat chicken minced or boiled, very lean, ground beef mixed with 2/3 boiled, plain white rice or pasta. This is an easily digested bland diet and won't irritate his stomach and intestines. Feed the bland diet mix for several days until his nausea clears, then slowly start mixing in his regular diet. It should take about a week to convert him back, mixing a little more regular and less bland in each meal.
You can also give him probiotics to replace good bacteria in his gut. Fortiflora, Proviable, and Benebac are very good. Your veterinarian or many larger pet stores carry them.
If even with the acid reducing medication, his food fast, probiotics and bland diet he still is vomiting or refusing to eat he should be seen by a veterinarian on an emergency basis, otherwise he will become dehydrated.
Please let me know if you have any further questions.