"The clock is reset anytime the following occurs: illegal defense violation, personal foul, fighting foul, kicked ball, punched ball, ball hits the rim of the team which is in possession." It has to hit the rim, not the backboard.
nba.com/analysis/00422949.html no longer exists
NBA Rulebook Rule #7, Section IIc:
A team must attempt a field goal within 24 seconds after gaining possession of the ball. To constitute a legal field goal attempt, the following conditions must be complied with:
(1) The ball must leave the player's hand prior to the expiration of 24 seconds.
(2) After leaving the player's hand(s), the ball must make contact with the basket ring.
https://official.nba.com/rule-no-7-24-second-clock/