From first-principles calculations, the effects of h-BN and AlN substrates on the topological nontrivial properties of stanene are studied with different strains. We find that the quantum spin Hall phase can be induced in stanene film on a h-BN substrate under a tensile strain of between 6.0% and 9.3% with a stable state confirmed by the phonon spectrum, while for stanene on 5 × 5 h-BN, the quantum spin Hall phase can be preserved without strain. However, for stanene on a AlN substrate, the quantum spin Hall phase cannot be found under compressive or tensile strains less than 10%, while for 2 × 2 stanene on 3 × 3 AlN, the compressive strain needed to induce the quantum spin Hall phase is just 2%. These theoretical results will be helpful in understanding the effect of substrate and strain on stanene and in further realizing the quantum spin Hall effect in stanene on semiconductor substrates.