Exodus 20:5

5 You shall not bow down to them or worship them; for I, the LORD your God, am a jealous God, punishing the children for the sin of the parents to the third and fourth generation of those who hate me,

Read Exodus 20:5 Using Other Translations

Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me;
You shall not bow down to them or serve them, for I the LORD your God am a jealous God, visiting the iniquity of the fathers on the children to the third and the fourth generation of those who hate me,
You must not bow down to them or worship them, for I, the LORD your God, am a jealous God who will not tolerate your affection for any other gods. I lay the sins of the parents upon their children; the entire family is affected—even children in the third and fourth generations of those who reject me.

What does Exodus 20:5 mean?

John Gill's Exposition of the Bible
Exodus 20:5

Thou shall not bow down thyself to them
Perform any worship to them, show any reverence of them by any gesture of the body; one being mentioned, bowing the body, and put for all others, as prostration of it to the earth, bending the knee, kissing the hand, lifting up of hands or eyes to them, or by any outward action expressing a religious esteem of them, as if there was divinity in them:

nor serve them;
in a religious manner, internally or externally, by offering sacrifice and burning incense to them; by praying to, or praising of them; by expressing love to them, faith and trust in them, hope and expectation of good things from them, and the like. The reason of this second command, relating to the making and worshipping of images, next follows:

for I the Lord thy God am a jealous God;
jealous of his own honour and glory, and will not give it to another; even to graven images, nor suffer it to be given to them without resenting it; and jealousy is fierce and cruel, and breaks forth into great wrath, and issues in dreadful scenes oftentimes among men; as a man that has reason to be jealous of his wife, and especially if he takes her and the adulterer in the fact, it often costs them both their lives, being so enraged at such an insult upon him, and such a violation of the marriage bed; and thus the great Jehovah, the God of Israel, their head and husband, is represented, in order to deter from idolatry, or spiritual adultery, than which nothing could be more provoking to him:

visiting the iniquity of the fathers upon the children;
meaning chiefly, if not solely, the iniquity of idolatry; which being such an insult on his honour, "crimen laesae majestatis", is treated by him as high treason is among men; not only he punishes the authors and perpetrators of it in their own persons, which is meant by "visiting", but upon their children also, which are parts of themselves; and whatsoever is inflicted on them is the same as on themselves, and is an addition to, and a sensible aggravation of their punishment; and especially these are visited in such a manner, when they tread in their father's steps, and fill up the measure of their iniquity. So the Targum of Jonathan,

``visiting the iniquity of ungodly fathers on rebellious children:''

unto the third and fourth generation of them that hate me;
as all idolaters must be thought to do, whatsoever love and affection they may pretend to God, by worshipping idols before him, besides him, along with him, or him in them: "the third and fourth generation" are mentioned, because sometimes parents lived to see these, and so with their eyes beheld the punishment inflicted upon their posterity for their sins, which must be distressing to them; or, however, these being but small removes from them, might impress their minds and affect them, to think what their sins would bring upon their descendants, who would quickly come after them, and share in the sad effects of their iniquities, and so be a means to deter them from them.
California - Do Not Sell My Personal Information  California - CCPA Notice