Generally, the rule goes that you do what the custom is in the place where you live.

If you are in Eretz Yisrael (Israel) for the whole year (that is, for the three pilgrimage holidays - Pesach, Sukkot, and Shavuot), then you are considered as "living in Israel." The same goes for if you live in Chutz La'artetz (outside of Israel) for all three pilgrimage festivals. So let's consider possible situations:

  • You are an American, studying in Israel from September until June. However, Shavuot falls on June 15th, after you are already back in America. So, you practice two days of Yom Tov.
  • You are an Israeli, who is going to America for Pesach to visit your cousins. So since you are only going to be there for one of the pilgrimage holidays, you are only obligated to have one seder and one day of Yom Tov on each end of the holiday.
  • You are an Israeli who is now working in America for your kibbutz, running a shrink-wrap factory in North Carolina. You're staying here permanently for a few years until it's set up properly, you can return to your kibbutz, and someone else takes your place. You will practice two days of Yom Tov.