Give the starting pitcher a win if she pitches at least four of the seven innings, leaves the game with her team ahead and the team retains the lead for the entire game. If the pitcher fails to meet those qualifications she does not qualify for a win.
Credit the starting pitcher with a win in a five-inning game if she pitches at least three innings and leaves with her team ahead. Games can end after five innings due to weather or the mercy rule, which occurs when one team has a 10-run lead after five innings.
Credit a relief pitcher with a win if the starter does not pitch enough innings to qualify and only one reliever is used. This means that the reliever pitched the most innings and qualifies for the win.
Credit the most effective reliever with the win if the starter doesn't pitch long enough to qualify for the win and more than two relievers are used. In this scenario the winning team must maintain the lead the entire game, then the scorekeeper should use her best judgment to credit the most effective reliever with the win.
Give the relief pitcher the win if the score is tied or the eventual winning team falls behind. That reliever then becomes the pitcher of record and will be on the hook for a win or a loss. The one exception is a reliever who has a very brief or poor performance followed by a reliever with a strong performance. Again, the scorekeeper in that scenario can award the effective reliever with the win. Typically this has to be a showing where the first reliever only records one out or no outs and gives up many runs.
Remember that if a starting pitcher is removed for a pinch-hitter or pinch-runner while her team is behind and her team takes the lead before the next inning and before the reliever enters to pitch, then the starter would qualify for the win. To get a win the reliever has to enter the game behind or tied or have the starter not pitch enough innings to qualify.