We read about this command in Deuteronomy 21:18-21:
If any man has a stubborn and rebellious son who will not obey his father or his mother, and when they chastise him, he will not even listen to them, 19 then his father and mother shall seize him, and bring him out to the elders of his city at the gateway of his hometown. 20 They shall say to the elders of his city, ‘This son of ours is stubborn and rebellious, he will not obey us, he is a glutton and a drunkard.’ 21 Then all the men of his city shall stone him to death; so you shall remove the evil from your midst, and all Israel will hear of it and fear.
We can make a number of observations about this passage:
First, he doesn’t listen to correction (v.18), and he is stubborn and rebellious (v.20). Jeremiah uses these two words (“stubborn and rebellious,” sôrēr ûmôreh) to describe Israel when they were on the brink of judgment (Jer. 5:23). These terms can refer to “hardened rebels” or “stubbornly rebellious” (Jer. 6:28). This implies that people in the society have made a repeated effort to plead with this person.
Second, he is a glutton and drunkard (v.20). This wasn’t an innocent little child, who made a mistake. He was a mature adult, who was damaging people around him with his lifestyle.
Third, the parents don’t take justice into their own hands. They confer with the authorities. The community exercises the punishment—not the individuals.
Fourth, we have no example of this law ever being exercised. Kalland writes, “The OT does not contain an instance of this punishment being applied.”
 Kalland, E. S. (1992). Deuteronomy. In F. E. Gaebelein (Ed.), The Expositor’s Bible Commentary: Deuteronomy, Joshua, Judges, Ruth, 1 & 2 Samuel (Vol. 3, p. 134). Grand Rapids, MI: Zondervan Publishing House.
 Kalland, E. S. (1992). Deuteronomy. In F. E. Gaebelein (Ed.), The Expositor’s Bible Commentary: Deuteronomy, Joshua, Judges, Ruth, 1 & 2 Samuel (Vol. 3, p. 133). Grand Rapids, MI: Zondervan Publishing House.