On Pesach, Shavuot and Sukkot, Jews in Eretz Yisrael observe just one day of Yom Tov (one day of Shavuot, and the first and last days of Pesach and Sukkot), whereas Jews in the Diaspora observe two days of Yom Tov. This is because years ago, when Rosh Chodesh (the new month) was determined on the basis of witnesses' testimony to the sighting of the new moon, the court in Jerusalem would declare the new month and dispatch messengers to inform the Jewish communities. Distant communities would not receive the information until after Yom Tov, and since they were thus unsure as to which day was declared Rosh Chodesh, they had to observe two days of Yom Tov. Diaspora communities commemorate this practice by likewise observing two days of Yom Tov.
If a resident of Eretz Yisrael spends Yom Tov in a community in the Diaspora, does he observe the second day of Yom Tov?
The Gemara in Masechet Pesachim (52) records that Rav Safra, who lived in Eretz Yisrael and observed just one day, spent Yom Tov one year in a community that observed two days of Yom Tov. Out of respect for the community, which observed a second day of Yom Tov, Rav Safra, too, refrained from Melacha (forbidden activity) on this day, even though for him, as a resident of Eretz Yisrael, this was not Yom Tov.
Accordingly, the Shulchan Aruch writes (Orach Chayim 496:3; listen to audio for precise citation) that a resident of Eretz Yisrael who comes to a community in Chutz La'aretz (the Diaspora) for Yom Tov must abstain from Melacha on the second day of Yom Tov. The Shulchan Aruch emphasizes that this applies even if the individual comes only for a temporary visit and plans to return to Eretz Yisrael.
It should be noted, however, that since for this person the second day is not actually a Yom Tov, he would recite the weekday prayers, rather than the Yom Tov prayers. Likewise, he should wear Tefillin on this day, as he does on weekdays, though only in private, and not in the view of those celebrating a second day of Yom Tov. (Mishna Berura, 496:3, Seif Kattan 13)
Of course, this applies only if the individual comes to the Diaspora for just a temporary visit. If he comes with the intent of residing there permanently, then he is considered a full-fledged resident of the Diaspora, and he observes a second day of Yom Tov with the special Tefilot and without wearing Tefillin.
Summary: An Israeli resident who visits a community in the Diaspora during Yom Tov must abstain from forbidden activity on the second day of Yom Tov, but he recites weekday prayers and wears Tefillin.