Rule 508.3 · Declare Attackers Step
Triggered abilities that trigger on attackers being declared may have different trigger conditions.
Subrules
An ability that reads “Whenever [a creature] attacks, . . .” triggers if that creature is declared as an attacker. Similarly, “Whenever [a creature] attacks [a player, planeswalker, or battle], . . .” triggers if that creature is declared as an attacker attacking that player or permanent. Such abilities won’t trigger if a creature is put onto the battlefield attacking.
An ability that reads “Whenever [a player, planeswalker, or battle] is attacked, . . .” triggers if one or more creatures are declared as attackers attacking that player or permanent. It won’t trigger if a creature is put onto the battlefield attacking that player or permanent.
An ability that reads “Whenever [a player] attacks with [a creature], . . .” triggers if a creature that player controls is declared as an attacker.
An ability that reads “Whenever [a player] attacks, . . .” triggers if one or more creatures that player controls are declared as attackers.
An ability that reads “Whenever [a player] attacks [another player], . . .” triggers if one or more creatures the first player controls are declared as attackers attacking the second player. It won’t trigger if a creature is put onto the battlefield attacking or if a creature attacks a planeswalker or a battle.