It depends.
If your company relocates you to another country, then the time spent working for the Canadian company outside of Canada will count towards the 2 years out of every 5 year residency requirement for maintaining your PR status. If the time spent outside of Canada is just a business trip (not a permanent relocation), then the time spent outside of Canada will not count towards the PR residency requirement.
For the Canadian citizenship residency requirement (currently 3 years out of 4 years), any time spent outside of Canada (even if it's a permanent relocation) does not count.