You can apply for a spousal sponsorship with the sponsor being outside of the country only when the sponsor is a Canadian citizen. In this case you need to provide proof that you will relocate back to Canada when you spouse gets their PR. You cannot continue living outside of Canada.
But it doesn't mean you cannot continue to live outside of Canada even after the spouse landed.