Hi, there. Sure. If you don't live in Japan any longer, you can say: I was living in Japan for two years. (emphasizing the duration of your stay in Japan). I used to live in Japan for quite a while. (emphasizing that you don't live in Japan now.) I was in Japan two years ago. This is the simplest way to say you were there.