Multiplayer exp point

Hi i’ve done some match ate aoe3 online, on the last match i tryed to use england (so i start from level 1.
At the middle of the game i’ve reached level 4 of Englan and then i’ve lost the match.
when i come back to the server list i am again at level 1 for england.
Can someone explain me how it works. Do you only earn exp if you win or it’s a problem