The residence requirement is based on the time you have lived in Australia and the time you have spent outside Australia.
You must:
have been living in Australia on a valid Australian visa for four years immediately before applying which must include the last 12 months as a permanent resident, and
not have been absent from Australia for more than one year in total, in the 4 year period, including no more than 90 days in the year before applying.