The body of an NMOS is connected to the lowest voltage point in the circuit and for the PMOS the highest voltage point. which are usually the sources.
The reason is as follows.
Consider an NMOS. The body or substrate is p type and the source and drain are n type.
If the substrate is at a higher voltage than the source/drain than the body-source or body to drain p-n diode would turn on and the NMOS would not function properly.
In most applications, the source is at a lower voltage point than the drain. Hence the body is connected to source to ensure that the the diode does not turn on.
The body can also be connected to the circuit ground instead of the source like in the input pair of differential amplifiers. This gives negative voltage between source and body. But this leads to body effect which changes the threshold voltage of the transistor.