The complete excited-state sensing mechanism of a fluorescent probe capable of distinguishing cysteine/homocysteine and glutathione from analogous biological thiols has been investigated. Using a TDDFT method, the nature of the fluorescence differences in the detection of thiols by the probe has been explained at the molecular level. Calculation results imply that the probe undergoes photoinduced electron transfer (PET) from the fluorophore to the nitrobenzooxadiazole (NBD)-based acceptor in the excited state. In the presence of a thiol, the NBD moiety is cleaved and the red fluorescence emission of the fluorophore is enhanced through inhibition of the PET process. The sulfur-substituted NBD-thiol product is predisposed to undergo excited-state torsion, leading to fluorescence quenching. However, for cysteine and homocysteine, their appropriate distances lead to Smiles rearrangements with relatively low activation energies (26.60 kJ/mol and 42.94 kJ/mol, respectively) and the emission of a distinct green fluorescence at ambient temperature. It has been theoretically confirmed that the distance between two reactive sites, such as sulfhydryl and amino moieties, can be used to distinguish different thiols, thus providing rational support for the control of fluorescence activity and the design of probe molecules.