You need to spend a minimum of 2 years in the 5 years from initial landing date.
After the initial 5 years the 5 years becomes a rolling 5 years in that each time you enter the country you need to be prepared to show you have 2 years residency in the 5 years before the new entry into the country.
In effect from an initial landing someone could spend upto 3 years out of the country as long as when they return they stay put for 2 plus years to meet the 2 out of 5 residency obligation.
Failing to continue to meet the residency obligation should someone travel outside of Canada can result in the PR status being revoked at the border subject to appeal on returning to the country
The residency obligation is generally considered a very generous concession to give new immigrants the opportunity should they need to finalise anything in their home country before making the move permenant