Its quite straight forward.

If two teams can't be separated after normal time it goes to extra-time.

If one team scores more goals in extra time than the other they win; if no one scores any goals in extra time then it goes to penalties; if both teams score the same amount of goals in extra time then the away team wins.