The rule is as follows:
Credit a pitcher with a save when he meets all three of the following conditions:
(1) He is the finishing pitcher in a game won by his club; and
(2) He is not the winning pitcher; and
(3) He qualifies under one of the following conditions:
(a) He enters the game with a lead of no more than three runs and pitches for at least one inning; or
(b) He enters the game, regardless of the count, with the potential tying run either on base, or at bat, or on deck (that is, the potential tying run is either already on base or is one of the first two batsmen he faces); or
(c) He pitches effectively for at least three innings. No more than one save may be credited in each game.
Hope this helps!