https://www.newser.com/story/384710/legality-of-khameneis-ki...
His daughter, son-in-law, and grandchildren were civilians. Intentionally targeting civilians is a war crime. Even if they were not targeted directly, an attack is illegal if: it fails to minimize civilian harm, or the civilian casualties are disproportionate to the military advantage
International law is very clear on this point.
For the international law part, interesting debate i think, where the state acts in self-defense if it has sustained an “armed attack” by its adversary;. Obviously this is very broad, but i think you can easily argue the last 40 year of fire exchanges as a continued armed attack.