Exodus 20:71 has been historically interpreted by Jewish commentators as a prohibition of false oaths,2 not of simply speaking the name of God rashly.3 It states (in part),
You shall not lift up the name of Yahveh your god in vain.
לֹא תִשָּׂא אֶת שֵׁם יַהְוֶה אֱלֹהֶיךָ לַשָּׁוְא
Gesenius notes that the verb נָשָׂא (nasa) can mean to take up with the voice, i.e., to utter.4
Thus, to lift up the name of God in vain would be to utter it in vain (for falsehood).
It should be noted that the Hebrew word שֶׁקֶר (sheker), which occurs twice as often as שָׁוְא (shav), is a synonym of שָׁוְא (shav). Consider the following parallel from the Torah:
There we see an almost identical phrase with only the final words being changed: שָׁקֶר ↔ שָׁוְא.
Now, then, consider the following verse of Leviticus 19:12 in relation to Exodus 20:7:
And you shall not swear by My name in vain, nor shall you you profane the name of your God. I am Yahveh. KJV, 1769
וְלֹא תִשָּׁבְעוּ בִשְׁמִי לַשָּׁקֶר וְחִלַּלְתָּ אֶת שֵׁם אֱלֹהֶיךָ אֲנִי יַהְוֶה
While it is not completely apparent, Leviticus 19:12 is indeed a restatement of Exodus 20:7 which prohibits one from uttering false oaths in the name of Yahveh.
1 || Deu. 5:11
2 Philo, The Decalogue, Ch. XVII, §82–95; The Special Laws, II, Ch. 1, §2. Moshe ben Maimon (a.k.a., Maimonides), Mishneh Torah, Sefer Haflaʿah, Hilkhot Shvuʿot, Ch. 1, §7
3 e.g., saying “God damn it.”
4 p. 568, נָשָׂא
Gesenius, Heinrich Friedrich Wilhelm. Gesenius’s Hebrew and Chaldee Lexicon to the Old Testament Scriptures. Trans. Tregelles, Samuel Prideaux. London: Bagster, 1860.
Moshe ben Maimon (Maimonides). Mishneh Torah (משנה תורה).
Philo. The Works of Philo. Trans. Yonge, Charles Duke. Peabody: Hendrickson, 1995.