I hope by now you were able to get him to a veterinarian - were there any toxins/toxic foods in the trash? Is he vaccinated? When dogs get into the trash we commonly see symptoms such as vomiting/diarrhea but usually not severe. However there are certain foods that can be harmful to some dogs such as grapes, onions, raisins, chocolate and garlic (typically in large amounts) that can cause serious health issues if ingested - not to mention true toxic substances (cleaning products, chemicals). If you suspect any of the toxic FOODs, you can induce vomiting by having him swallow hydrogen peroxide (1 teaspoon for every 10 pounds of body weight). This is usually only successful within the first hour or two while it's still in the stomach. After that point, supportive care is KEY to their recovery which should be done at a veterinary clinic. This means keeping him hydrated (intravenous fluids), antacids, antibiotics to fight infection due to the compromised stomach/intestinal lining. If this is not possible, try administering pedialyte (non-flavored) orally in small amounts via syringe (available at local pharmacy). If he is able to keep it down, you can give more (a 15lb dog typically intakes 2-3 cups of water per day on average). If he feels cold, you should take his temperature rectally to make sure he is not hypothermic. A normal body temperature for a puppy is between 98 - 102.5F. If he is cold, provide a safe heat source (heating pad with towel on top) and blankets. Sometimes a hair dryer can also provide additional heat but keep your hand on the puppy while you use the dryer to monitor the heat output so it does not burn him. Also, if he is able to keep the electrolyte solution down, you can try offering a canned food in small amounts. You can also give him Pepcid AC 10mg - Give 1/2 tablet by mouth twice daily until you can get him to a vet.
Again, I strongly recommend finding a way to get your puppy to a veterinarian soon. Since I am unsure of his vaccination status, living situation (indoor/outdoor) among other crucial information, it is difficult to say exactly what the cause of the problem is. There are many other diseases and medical conditions that can present with these clinical signs so having your veterinarian assess him is the most important thing you can do for your puppy. If this is a case of toxicity, the instructions above can buy you some time but again, it depends on what he got into and IF this is his primary problem. Good luck and please let us know how he did.