Bodies are in thermal equilibrium if there is no net flow of energy. This happens when they are at the same temperature.
Thermal energy is always transferred from regions of higher temperature to regions of lower temperature. According to the zeroth law of thermodynamics: if body A and body B are in thermal equilibrium with body C, then body A and body B must be in thermal equilibrium with each other.
There is an absolute scale of temperature known as the thermodynamic scale (Kelvin) that does not depend on the properties of a particular substance, unlike the Celsius scale (uses the freezing and boiling point of water.