This verse is complex. Here are some brief thoughts.
The Hebrew word תֹורָה (torah) does not translate as "the Law" (note the definite article), but simply "law" or "a law."
At first impression, one may be inclined to think that the phrases "the mountain of YHVH" and "the house of the God of Ya'akov" refer to a rebuilt physical Temple in Yerushalaim.
However, the New Testament reveals that the Messiah and his body (the Church) is a spiritual Temple. Christians are said to grow into a holy Temple in the Lord (Eph. 2:21). Paulos states that Christians are "the temple of the living God" (2 Cor. 6:16). Petros states that Christians "as living stones, are built into a spiritual house" (1 Pet. 2:5). Therefore, what one may have assumed to be a prophecy about the physical Temple rebuilt in Yerushalaim --- the "house of YHVH" and the "house of God" --- can certainly now be understood as the Church itself, the body of Christ. For, the Church is referred to as a "temple" and a "spiritual house."
The rabbis connected two scriptures together: Isa. 2:3 and Isa. 51:4.
In his commentary on Isaiah 51:4, regarding the phrase כי תורה מאתי תצא ("for a law shall forth from Me"), Rabbi David Kimchi wrote, כמו שאמר בתחילת הספר כי מציון תצא תורה, כי המלך המשיח יורה העמים ללכת בדרכי ה', וזה יהיה אחר מלחמת גוג ומגוג, that is, "Like what it says in the beginning of the book, 'For from Tzion shall go forth a law...' For, the King Messiah shall teach the nations to walk in the ways of YHVH, and this shall be after the war of Gog and Magog."
Why does Kimchi connect Isa. 2:3 and 51:4?
Both scriptures refer to תורה ("a law") and use the verb תצא (tetze). The translation "go forth" is a bit ambiguous. In the sense of a law or command, it means "to be promulgated." Of course, laws are typically promulgated by lawgivers. For example, Moshe promulgated the Torah of Moshe at Sinai. Yet, the prophet Yesha'yahu prophesies that a law would be promulgated "in the last days" from Tzion, that is, Yerushalaim, even from God Himself. Of course, one might say that the Torah of Moshe was promulgated by God Himself, by the proxy of Moshe. However, that did not occur "in the last days," nor did it occur from Tzion/ Yerushalaim. The fact that the prophet states that "in the last days" a law (torah) shall be promulgated (future tense) from Tzion/ Yerushalaim compelled the rabbis to acknowledge that Yesha'yahu was referring to a new Torah, rather than the Torah of Moshe.
Here are final thoughts from the midrashim:
In Midrash Vayikra Rabba, Parashah 13, it is written,
אמר רבי אבין בר כהנא: אמר הקב"ה: תורה חדשה מאתי תצא, חדוש תורה מאתי
תצא
Rabbi Avin bar Kahana said: The Holy One, blessed be He, said, "A new Torah shall proceed from Me." A new interpretation of the Torah shall proceed from Me.
In the Midrash Otiot deRabbi Akiva, Folio 29a, it is written,
והקב"ה דורש להם טעמי תורה חדשה שעתיד הקב"ה ליתן להם על ידי משיח
And the Holy One, blessed be He, expounds to them the meanings of a new
Torah which, in the future, the Holy One, blessed be He, will give
them by the hands of the Messiah.
In Midrash Kohelet Rabba, Parashah 11.8, it is written,
.ישמח, בשמחת התורה
.ויזכר את ימי החשך אלו ימי הרעה
כי הרבה יהיה. תורה שאדם למד בעולם הזה
.הבל, היא לפני תורו של משיח
"Let him rejoice" – during simchat Torah.
"but, let him remember the days of darkness" – these are the days of evil.
"for, they shall be many" - the Torah that a man learned in this world is
"vanity" - is [vanity] in the presence of the Messiah's Torah.