They level up when fighting beside you, but also level when not in use. How does this work? Do they gain all XP for both their kills and your kills (like party members)? Do they gain more XP when fighting at your side than when not in use? Do they still gain XP when "dead"? Does the follower class affect their rate of XP gain? Are all three followers at the exact same XP level, or are there any slight differences?
I quickly tested it, and it's pretty simple:
First of all, as long as they are walking around with you, your followers receive exactly the same amount of experience you do. Any equipment for +XP they have only effects you (you get 20% of it), not them.
You earn XP for your own kills, and for the kills your followers make. You can't use followers while in a party with other people, so they will have to stay at home in that case. Also, the follower type does not influence the rate of XP gain.
Second, your followers in the camp don't earn XP at all, but: Whenever your currently hired follower levels up, they level up, too, and their current XP is set to 0 of the next level. Even if you don't have any followers with you at all, they are aligned so that they stay at your level -1. This means that your followers keep up, no matter what you do. You won't have to worry about them getting underleveled if you play a lot of coop.
I just arrived in Act II, not having yet used a follower. On checking their skills and inventory, I was able to choose skills for them (the Templar and the Scoundrel) up to one level minus my current level.
I am currently halfway to level 17 and each one of them is at level 15, without ever being in battle.
This means that regardless or whether or not they travel alongside, they still gain the experience. We should then be able to deduce that this also means that when they DO fight alongside that they do not "steal" any of the experience.
This is obviously different from Diablo II where, at least my course of action, was to keep one hire alongside as long as possible so they continued to get stronger and level up as well.