hello and thanks for the query,
well going by the history your son has developed an episode of gastroenteritis
and since you say it is foul smelling mostly it is bacterial, I would suggest you take him to the paediatrician and get him evaluated if he has lost too much of fluids and is dehydrated he might need fluid replacement therapy for now if he is able to take oral fluids do make him take the electrolyte solution. the doctor will start him on the suitable antibiotics and medications, a stool and blood culture
maybe needed to identify the causative organism.