Hezbollah is part of the elected government within the in internationally recognized borders of Lebanon. It might be illegal for them to fire at Israel, but it's not illegal for them to be present. It is illegal for Israel to be present within Lebanon's borders.