The key claim is that the positions of the Ms fully determines the end configuration. Indeed, since all Hs are initially left of all Ts, the only successful swaps that can occur will involve Ms. So, picking $\binom{8}{4}=70$ spots for Ms and then filling in the remaining 4 spots with Hs first and then Ts gives all possible arrangements. It is not hard to show that all of these arrangements are also achievable; just greedily move Ms to their target positions.
Richard starts with the string HHMMMMTT. A move consists of replacing an instance of HM with MH , replacing an instance of MT with TM, or replacing an instance of TH with HT. Compute the number of possible strings he can end up with after performing zero or more moves.