Pesachim 50b: If one goes from a place where they work on Erev Pesach morning to a place where they do not work, or vice versa, he must follow the stringencies of both places.
פסחים נ ע”ב: ההולך ממקום שעושין למקום שאין עושין או ממקום שאין עושין למקום שעושין נותנין עליו חומרי מקום שיצא משם וחומרי מקום שהלך לשם.
שו”ע או”ח תצ”ו ס”ג: בני ארץ ישראל שבאו לחוצה לארץ אסורים לעשות מלאכה ביום טוב שני בישוב אפילו דעתו לחזור, וכל זמן שלא הגיע לישוב אפילו אין דעתו לחזור מותר לפי שעדיין לא הוקבע להיות כמותן אבל אם הגיע לישוב ואין דעתו לחזור נעשה כמותן ואסור בין במדבר בין בישוב וכל חוץ לתחום אין נותנין עליו חומרי מקום שהלך לשם.
The Shulchan Aruch (Orach Chaim 496:3) rules that keeping one day Yom Tov in Eretz Yisroel or two days outside of Eretz Yisroel falls in the category of minhag hamakom and is subject to the rule in our Mishnah. However, the Chacham Tzvi (167) disagrees. He writes that minhag hamakom applies only in questions of halacha, where the same halacha applies in all locations, yet different communities follow different opinions. For example, the Gemara says that Eretz Yisroel and Bavel followed two different practices as to whether a certain fat is permitted. What is forbidden fat is forbidden everywhere, but certain places had a minhag to follow the opinion that considers certain fats not forbidden. If the community that considered it forbidden were to move en masse to the other location, they would continue to refrain from eating it, because the prohibition is not dependent on location. But Yom Tov Sheini is not a universal halachic question; it simply depends on whether the messengers of Beis Din reached that particular place. Therefore, people from Chutz Laaretz who are staying temporarily in Eretz Yisroel should only keep one day Yom Tov, just as they would if they had visited during the time when Beis Din sent out messengers.
When the Satmar Rav lived in Eretz Yisroel for a whole year in 1945-46, he kept only one day Yom Tov. After moving to the United States, he made four visits to Eretz Yisroel (in 1952, 1955, 1959 and 1965). He was always careful not to be in Eretz Yisroel over Yom Tov, so as not to run into the dilemma of whether to keep one day and risk doing work on Yom Tov, or to keep two days and risk neglecting the mitzvah of tefillin. Although most poskim agree with the Shulchan Aruch, he felt that as a descendent of the Chacham Tzvi, he should be careful not to violate the Chacham Tzvi’s opinion.
Source: Rabbi Moshe Zoberman, shiur on Taanis 10b