When Oath of Kaya enters the battlefield, it deals 3 damage to any target and you gain 3 life.
Whenever an opponent attacks a planeswalker you control with one or more creatures, Oath of Kaya deals 2 damage to that player and you gain 2 life.
If an opponent attacks more than one planeswalker you control, the last ability of Oath of Kaya triggers once for each of those attacked planeswalkers.
If the target is an illegal target by the time the first ability of Oath of Kaya tries to resolve, the ability doesn’t resolve. You won’t gain 3 life.