You have a lot of research to do. You don’t qualify to do a residency if you are not a citizen or PR. If you do become a PR you would have to pass the licensing exams and try to get a residency spot. The biggest issue is that you are highly unlikely to ever get a residency spot especially as a specialist. There are very few residency spots after Canadian graduates have been matched. Then Canadians students that studied abroad or Canadian graduates who haven’t matched the first time or want to switch specialties get the first chance to pick any leftover residencies. Most in the 2nd group can’t find a residency. The next group to select from the leftover residency spots are the international medical graduates (IMGs). Unless you studied and trained in one of a few countries IMGs have to repeat their residencies in Canada. The problem is there are no residency spots available. Currently only around 1% of IMGs get licensed to be able to practice medicine in Canada and it is usually limited to family medicine. Often family medicine in remote or rural communities. There are a few provincial retraining programs for family doctors in rural/remote locations. Believe that may be 20-40 spots per year. Would discourage IMGs from moving to Canada if they want to practice medicine. Would consider other countries like the UK, US, other European countries, Australia, NZ and gulf countries once you finish your residency in your home country or you can look to see if you can complete your residency in the countries.
There is lots of information available. Surprised you have not done more research already. There are plenty of stories of IMGs or Canadian citizens who went to school abroad who can’t get residencies spots in Canada and aren’t able to practice.