Rule explained
When a run doesn't count
A run doesn't score if the third out of the inning is a force out, or the batter-runner is put out before reaching 1st, even if the runner crossed home first.
A run also doesn't count if the third out comes from an appeal on a runner ahead of him who missed a base or left early.
On any other third out (a tag out, or a runner doubled off on a caught fly ball), it's a time play: the run counts if it crossed home before the out was made.
Coaches use this to choose between going home and turning two. A completed double play that ends with a force at 1st wipes out the run.
Quick answers
Only if the third out isn't a force out. If the third out is the force at 1st, the run doesn't count.
Situations this rule decides
Plain-English summary. Check the Official Baseball Rules and your league's rules for the exact wording.