Customs in two countries?

So, I have never traveled internationally before. I have a flight that goes from Dallas, to Toronto, to Edinburgh Scotland. I was just wondering, do I need to go through customs in Toronto AND Edinburgh? Or just one or the other? Thank you!
9 answers 9