2 years in any 5 year period but it's normally only checked when you apply to renew your PR card or if you are outside Canada and need to get in.
Say somebody landed as a PR and stays in Canada for a year. He then leaves for 3 years, comes back for a year. By now, it's 5 years and he can apply to renew his PR card based on 2 years in Canada, no problem. If he then leaves for a year after renewing his PR card, looking back at the previous 5 years, he would have 3 years outside, 1 year inside and then 1 year outside so he has already lost his PR.
If he were to lose his PR card at this point and wants to go back to Canada and has to apply for a travel document, he would not get it. If he doesn't lose his PR card, he will probably be able to go back to Canada without a problem and when he needs to renew again will have to make sure that at that point, his last 5 years include 2 in Canada.
Sometimes they catch people at the point of entry and accuse them of not having met their residency requirements. I am not sure what exactly they base that on but if that happens, they will let you in and give you a chance to prove that they are wrong and that you have at least 2 out of the last 5 years in Canada. If you fail to prove that, you lose your PR.
The 6 months comes from the old rules prior to 2003 or so. At that time, they had that you had to stay 6 months in Canada out of any 12.