Take him to the vet immediately!
It is possible he has eaten feces outside, and vomited them up. But another concern would be if he had some sort of internal blockage and this caused him to do that. I would keep a very careful eye on him over the next 24 hours. If it happens again, and you can definitely say he has not been eating anything inappropriate, you must take him to the vet as soon as possible.
Meanwhile monitor him for any other signs of illness (such as lethargy, weakness, refusal of food or water, etc.)
Jerry is right, this is not all that uncommon. Disgusting. I know.
It is called Coprophagia. I suggest you look that up and read about it.
Yes, the best you can do is puck up the stools as soon as he goes. You might try a food change. There are things you can add to the food to maybe deter this, maybe not.
I assume the vomiting is from the stool eating but, if it continues, I would have him checked and take a stool sample in to the Vet to be checked.
This is not uncommon in my experience. The best I can offer is to carefully pick up the "poop" and put in trash (plastic shopping bags work well). This my pass and unpleasant as the suggestion is it may be worth a try.
We have a large property and a small dog, so I don't pick up behind our dog.. it all decomposes and he's good about going away from the house so stepping in it is unlikely.