Hello, my name is***** and I have over 20 years of experience as a veterinarian. I am sorry to hear that Alfie isn't feeling well, lethargic with vomiting and gagging, dark stools and lack of an appetite
If his stomach is empty all he will have left to bring up is esophageal/stomach mucous and that mixed with air as he gags makes the foamy phlegm you are seeing. His continued gagging/retching means that he is very nauseous.
He is likely dehydrated because he vomited, is continuing to gag up mucous, isn't eating and is barely drinking, but if even water is making him vomit you need to take it away from him for now.
In most cases vomiting is triggered by eating something they should not, too much table food, too many treats or something they find outdoors.
More serious causes of vomiting in puppies include viral or bacterial infections, a dietary allergy or sensitivity, congenital internal organ failure (kidney or liver disease), or a full or partial gastrointestinal obstruction.
In a young dog, especially one that hasn't finished his vaccine series, a viral infection such as Parvo virus or a foreign body leading to a partial or full gastrointestinal obstruction would be the most likely cause and both can be deadly. Not all dogs with viral infections run a fever initially, sometimes they are too weak to mount a fever response. Worms can cause loose stools, but rarely cause vomiting and lethargy.
Because he is young, this has been going on for more than a day, and he is continuing to gag ideally he would see a veterinarian now. Young puppies dehydrate easily and he needs fluids.
If that isn't possible for whatever reason there are some things we can try at home, but we cannot replace in clinic intravenous fluids and injectable medications so if he isn't responding quickly he should see a veterinarian promptly.
To try and settle his stomach you can give either:
1) Pepcid ac (famotidine) at a dose of one quarter of a 10mg tablet per 5 to 10 pounds of body weight every 12 hours
2) Prilosec (omeprazole) at a dose of one quarter of a 10mg tablet per 5 to 10 pounds of body weight every 24 hours
These are acid reducers and may help him feel less nauseous and hopefully stop the vomiting and improve his appetite. They are quite safe and can be used for several days if necessary. I understand that these are prescription medications in the UK, so you may not have them available, but they are the only safe, appropriate medications to try in a nauseous puppy.
I would pick up all food for now and water for a couple hours to allow his stomach to settle after the acid reducers.
In a couple hours when you give him water make sure it is in small amounts only. If he drinks too much too quickly that can lead to vomiting. To get some electrolytes in you can also offer her a 50:50 mix of pedialyte and water.
If there is no vomiting/retching for 6 hours offer a bland diet of 1/3 boiled, minced, white skinless chicken or boiled, lean hamburger and 2/3 boiled, white rice mixed with some low salt chicken or beef broth to make it easy to lap up and swallow and get additional fluids into him. If he refuses that, you can offer a little meat baby food. If he refuses both then he needs hands on veterinary care as soon as possible.
But if things go well and he does eat the bland diet and doesn't vomit feed him the bland diet for 3 to 4 days then slowly start to mix back in his regular food, a little more at each meal. It should take about 5 to 7 days to slowly convert him back to his regular diet.
If he continues to vomit even with the acid reducers, runs a fever (more than 103F rectally), or has a lower than normal temperature (less than 99F), has a tense painful belly, or if he refuses to eat even after the acid reducer is given he should see a veterinarian for an examination, diagnostics, injectable anti-nausea drugs, intravenous fluids and supportive care.
With the description that you have given me I would be very worried about Parvo virus and ideally that should be treated on an inpatient basis with fluids and injectable medications to give him the best chance at getting well.
Please let me know if you have any further questions.