Quebec requires you to be in Quebec for at least 183 days per year. Ontario is similar, only that you have to be in Ontario for at least 153 instead of 183 days per year.
Quebec RAMQ has something called prolonged absence. For example, students studying abroad, people working for the Quebec/Canadian government abroad, or people working under contract in certain countries (such as France and Sweden) that has special agreement with Quebec are ok to be away for over six months. There are also things like working for non-profit organizations etc.... See the following website to see if you fall under any of those categories. http://www.ramq.gouv.qc.ca/en/citoyens/assurancemaladie/absenceprolonge.shtml
For any other reasons, people are allowed to be out of Quebec for up to a year every seven years.
Other than that, I am afraid you will have to lose the health benefits in Canada.