If your spouse is a Canadian citizen, you are accompanying him or her abroad, and you can supply proof of this (documents showing common address such as utility bills, rental agreements, vehicle registration/insurance etc.), then time spent as such counts towards the 2 out of 5 year residency...