There are 2 types of sacrifice ‘hits’. Sacrifice bunts (sac) and sacrifice flys (SF). These are covered in Scoring Rule 10.08.
The sacrifice fly rule is fairly straightforward. A batter should get credit for a SF, when he hits a fly ball that is caught, but is deep enough for a runner to tag up and score. If an outfielder drops an easily catchable ball and a run scores, the batter should also get credit for a SF (and the fielder gets an E), unless there are 2 outs. In other words, credit a sac fly if it would have been one without the error. The batter also gets an RBI on a sac fly.
In contrast, the sacrifice bunt rule requires the official scorer to have some mind-reading abilities. The basic premise for scoring a sac is that the batter bunted and advanced a runner (or more), while getting himself thrown out at first base. However, if in the scorer’s judgement the batter was trying to bunt for a hit, then it should be charged as an at bat instead of a sac. The inning, score and # of outs can be used to help determine a batter’s intentions. For example, if the winning run is on 2nd base in the bottom of the 9th inning with nobody out, a bunt would be a classic example of a sacrifice bunt. If, however, the team is losing by 3 runs, a “successful” sacrifice bunt should likely be scored just as a ground out.
A sacrifice bunt can also be scored, if the runners advanced while the defense tried to put them out instead of batter. Note that if the defense would not have been able to put out the batter, than you can score it as a base hit instead of a sacrifice (e.g. runner on 2nd, perfect bunt towards 3rd with no chance of getting the batter, and defense tries unsuccessfully to get runner going to 3rd – score it as a single).
Additionally, if any runner is put out trying to advance a base on a bunt, then no sacrifice is scored. It just becomes a routine fielder’s choice.
Oh, and David Ortiz… please stick to hitting walk-off bombs, please.