I found the best way to rank up is to do the gun challenges, you'll find them in barracks when you're in a lobby.
Dont do what i did and find your favourite gun and keep using it. You'll wonder why your mates are ranking up well faster than you

Try and do a weapon class at a time though, because you'll need to change your playing style depending on class. i.e. you won't have much luck trying to snipe people with a shotgun from the other side of the map.
I think after 150 kills with a weapon you get 1000xp and there's also challenges for headshots etc.
if you struggle to get kills play domination as you get xp for capturing objectives too