The quantum Rabi model can be solved exactly by the Bargmann transformation from real coordinate to complex variable recently [Phys. Rev. Lett. 107, 100401 (2011)]. By the extended coherent states, we recover this solution in an alternative simpler and perhaps more physical way without uses of any extra conditions, like Bargmann conditions. In the same framework, the twophoton Rabi model are solved exactly by extended squeeze states. Transcendental functions have been derived with the similar form as those in one-photon model. Both extended coherent states and squeeze states are essentially Fock states in the space of the corresponding Bogoliubov operators. The present approach could be easily extended to study the exact solvability or integrability of various spin-boson systems with multi-level, even multi-mode.