This question already has an answer here:
I am a US citizen and have been granted a temporary residence permit in Sweden on the grounds of visiting my father who lives there. I first stayed in the Schengen area for the full 90 day period which is allowed on the free US travel visa, and received the temporary residence permit on the last day of this period. It extended my stay in Sweden by 5 1/2 months and only allows me to stay in Sweden. When this extension expires in March, I would like to take some time to travel in the rest of Europe. I want to know if I am legally allowed to do so. I know that US citizens are allowed 90 days in 180 day period, and my 180 days are up in Jan, but I will stay in Sweden until March. Would it be best for me to exit Schengen from Sweden and then reenter through another country? Or do I have to go home?