We provide the exact non-Markovian master equation for a two-level system interacting with a thermal bosonic bath, and we write the solution of such a master equation in terms of the Bloch vector. We show that previous approximated results are particular limits of our exact master equation. We generalize these results to more complex systems involving an arbitrary number of two-level systems coupled to different thermal baths, providing the exact master equations also for these systems. As an example of this general case we derive the master equation for the Jaynes-Cummings model. In order to describe these systems one needs to consider a non-static bath, i.e. a bath that keeps track of the interaction with the TLS. Accordingly, some memory effects build up and the dynamics is non-Markovian. Several tentatives have been made to provide a non-Markovian master equation for the spin-boson model, exploiting e.g. the noninteracting-blip approximation [3], the time convolution-less technique (TCL) [1,6], or the stochastic approach [7]. However, only approximated results were obtained. The lack of an exact analytical description lead to investigate the problem by means of numerical techniques, among which we mention hierarchical equations of motion [8], * Electronic address: ferialdi@fmf.uni-lj.si arXiv:1609.00645v3 [quant-ph]