Thermal equilibrium implies equal temperatures: temperature can be defined as the inverse of a derivative of the entropy in respect to the internal energy:
$$
\frac{1}{T}=\left(\frac{\partial S}{\partial E}\right)_{V,N},
$$
where $S$ and $E$ are both functions of state. It can then be shown for two bodies that initially have temperatures $T_1, T_2$ and can exchange heat, that the overall entropy increase will be:
$$
\Delta S=-\left(\frac{dS}{dE}\right)_1\Delta E+ \left(\frac{dS}{dE}\right)_2\Delta E = \left(\frac{1}{T_2}-\frac{1}{T_1}\right)\Delta E.
$$
That is, if $T_1>T_2$, the heat will flow from the first body to the second, so that the overall entropy increases (here $\Delta E = \Delta E_2 =-\Delta E_1=0$).
Thus, in tehrmodynamic equilibrium the net heat flow is zero and the temperatures are equal.
However, heat exchange is not the only means by which two systems can come to thermal equilibrium - the internal energy can be changed by performing work (i.e., by macroscopic energy transfer, whereas heat is microscopic energy transfer) as well as by particle exchange. The full thermodynamic equilibrium thus also requires additional conditions on pressures, chemical potentials, etc.