The fainted pokemon receive experience. this originates the problem of fainted pokemon with HP, because they level up being "dead", and they earn HP, but they are still fainted. If the first pokemon is fainted, you will fight with the second one. But only the fainted pokemon will receive experience.
Second: If a pokemon enter to a battle twice, it will receive experience two times, if it where two pokemon, for example: If I start a battle with Lugia, and then I change it with Mewtwo, and then I change mewtwo with Lugia. Lugia will earn 66% of the experience.
Second: If a pokemon enter to a battle twice, it will receive experience two times, if it where two pokemon, for example: If I start a battle with Lugia, and then I change it with Mewtwo, and then I change mewtwo with Lugia. Lugia will earn 66% of the experience.