For a process that occurs at constant temperature and pressure, spontaneity can be determined using the change in Gibbs free energy, which is given by:
where the sign of ΔG depends on the signs of the changes in enthalpy (ΔH) and entropy (ΔS). If these two signs are the same (both positive or both negative), then the sign of ΔG will change from positive to negative (or vice versa) at the temperature 
In cases where ΔG is:
* negative, the process is spontaneous and may proceed in the forward direction as written.
* positive, the process is non-spontaneous as written, but it may proceed spontaneously in the reverse direction.
* zero, the process is at equilibrium, with no net change taking place over time.
This set of rules can be used to determine four distinct cases by examining the signs of the ΔS and ΔH.
* When ΔS > 0 and ΔH < 0, the process is always spontaneous as written.
* When ΔS < 0 and ΔH > 0, the process is never spontaneous, but the reverse process is always spontaneous.
* When ΔS > 0 and ΔH > 0, the process will be spontaneous at high temperatures and non-spontaneous at low temperatures. 
* When ΔS < 0 and ΔH < 0, the process will be spontaneous at low temperatures and non-spontaneous at high temperatures.
For the latter two cases, the temperature at which the spontaneity changes will be determined by the relative magnitudes of ΔS and ΔH.