“therefore Yahweh your God commanded you to keep the Sabbath day.” God rested on the seventh day in Genesis 2:1-3, but He did not command that anyone follow His example and rest on the seventh day until Exodus 16, when He gave the manna from heaven, and even then He did not fully explain the Sabbath. The Sabbath became part of the Law and the Old Covenant when it was given as part of the Ten Commandments (Exod. 20:8-11).
[For more on the Sabbath, see commentary on Exod. 20:10.]