Sometimes, if you leave a match and your team wins 4v5 you'll get the match counted as leave instead of win.
I remember reading somewhere that for the match to be counted as a win you need either to be connected in the moment the game finishes (even if you've been AFK earlier in the game) or you need to have been active for some % of the length of the game.
Is this correct? What are exactly the criteria that decide whether a match in which a player has been AFK will be counted as leave or with a normal win/loss result for that player?