Resident means living there. Like I said, as a student that may not necessarily count as part of your 5 years. It depends where you come from originally and what agreements the Polish government may have with your country of origin. If you are from an EU country then studying will count towards those 5 years but it may not count from a non EU country.