Maybe a little more precise. The two results are added (aggregated). When this makes a draw, the away goals count double (just as jasper explaned)
Example: Feijenoord Rotterdam played In Scotland 1-1 against the Glasgow Rangers, when they draw 0-0 in Rotterdam they are through.
BTW: this example doesnt mean I am a fan of Feijenoord