If Toronto, Baltimore, and Detroit are tied.. Let's see what happens
Toronto has edge on season series against both teams (10-8 against the O's with one more to go, and 4-3 against the Tigers)
Baltimore has better record against Detroit, but not Toronto (8-10 against the Jays with one more to go, and 5-2 against the Tigers)
Detroit do not have better record against neither teams. (3-4 against the Jays and 2-5 against the O's)
So Toronto and Baltimore both won the series against Detroit, and Toronto already has better record against the O's..
So that means Detroit and Baltimore would have to play a tie-breaker game (maybe in Baltimore) and the winner will face the Jays at the dome.