If you leave a game you are given a loss and the position you left in e.g if there are 2 others left in the game when you leave, you are 3rd. The AI that takes over for you has no baring on your position. If your AI wins, you do not win and are still given the 3rd place when you left.
As for what happens when you are the last human player and leave. If you leave or disconnect when you are the only human player in the game, the game will close and you are not given a win or loss. This occurs because a game must always have a host and once you as the only available host leave, the game ends.
I just noticed an error with this question. The second part is still valid as Greggy83 has also requested.
However, with the first part I suppose I was trying to simplify this down to two players where it doesn't work (they would both receive and lose nothing as the game would come down to the CPU). What I'm more after is clarity that if (and at the extreme) one person won but everyone else (say 5 players) left at the same time, the winner would receive 1st, while all others would receive equal 6th. Would this then give the winner a great ranking score or a minimum ranking score?
Yes you still get credit for beating them as if they were human players. If you had left, no you would not been given the win.
The easiest way to think about it is. If a player leaves, they loose, but you still have to beat their AI to get the win.
The green CPU gets the win, but the player who left does not. You need to actually win the game to get a win.