Permanent residence means living for at least 185 days of each calendar year in Sweden as a consequence of a professional or personal link that is characterised by a close connection between a person and the place where he or she lives. If you live alternately in two or more states because your professional link is different from your personal link, your permanent residence is the place with which you have a personal link.
This applies on condition that you regularly return there. If you perform a task for a certain predetermined period of time in another country, you do not need to return regularly to the country where you have a personal link in order to be considered as being a permanent resident there. Studies at university or at some other institute of education do not entail any change in permanent residence.