Let's say I'm talking to someone about my past experience and I want to say that I've been in New York for 2 months. "I spent 2 months in New York when I was 17." "I was in New York for 2 months when I was 17." Do you see any differences? As a non-native speaker, it's hard for me to say how they are different. Thanks in advance.
When considering a question such as this, you simply need to 'spot the difference' in the two sentences, and then analyse for meaning:
"I spent 2 months in New York when I was 17."
Past simple and past participle of spend -- Cambridge
To use time doing something or being somewhere. -- Cambridge
The verb spend connotates that time was used. The emphasis is on the fact that you spent 2 months in New York, when you was 17, and consequently the listeners attention is shifted to the idea that these are two months that were valuable (as you will not have them back, and they have been spent).
I was in New York for 2 months when I was 17.
Does not carry with it the same emphasis on the valuable time that you spent, the idea of an exchange of time for experience is not as strong in this sentence, you were simply in New York for 2 months.