Canalian said:
If I apply for PR via CEC, can I leave Canada while my application is being processed or do I need to remain in the country?
You can leave; you don't even need to be in Canada when you apply.
Either way, think about getting an RCMP clearance while you're living in Canada. The application guide says you don't need a police certificate from Canada, but they may ask for it during processing (for whatever reason), and the RCMP will take at least 3 months to send the result if you do it from outside of Canada. If you do it from within Canada it's 3 days, plus mailing time.