If one of the targeted players is an illegal target when the triggered ability of Axis of Mortality tries to resolve, the exchange won't happen. Neither player's life total will change.
When the life totals are exchanged, each player gains or loses the amount of life necessary to equal the other player's previous life total. For example, if player A has 5 life and player B has 3 life before the exchange, player A will lose 2 life and player B will gain 2 life. Replacement effects may modify these gains and losses, and triggered abilities may trigger on them.
If a player can't gain life, that player can't exchange life totals with a player with a higher life total. If a player can't lose life, that player can't exchange life totals with a player with a lower life total. In either of these cases, neither player's life total will change.
In a Two-Headed Giant game, each player is considered to have the same life total as his or her team. If the two targeted players are on different teams, those players gain or lose the appropriate amount of life so that the teams end up exchanging life totals. If the two targeted players are teammates, they can't exchange life totals.