Two hours should be plenty of time for that connection in YYZ. I just transited there 10 days ago. When approaching the immigration area tell the agent directing the flow of passengers that you are making an onward international connection. They take you to a separate line so you never enter Canada. It was incredibly quick and easy.