It's easier than you think. Just add up the result of both matches and if the total is a tie (let's say it's 3-2 and 0-1 = 3-3), then then team who scored more away goals (2), wins.