Question 1: Each "element of the sample space" is a sequence of 9 results, each result being T or H. The two tails can't be the starting or ending pair, or the sequence would both start and end with a pair, because all the rest must be heads. But both the tails can't be in the middle 5 positions, or again the sequence would start and end with a pair (both pairs being heads in this case). So we have a couple of cases. Case 1: One T in one of the middle 5 positions (5 possibilities), which requires the other T to be in any of the remaining 4 positions (4 possibilities). Case 1 gives us 5 * 4 = 20 possible sequences. Case 2: No Ts in the middle 5 positions. But then they must be on opposite ends, where each has 2 possible positions (at the end or adjacent to the end). So case 2 gives us 2 * 2 = 4 possible sequences. A total of 20 + 4 = 24 sequences satisfy these criteria.
Question 2: Case 1: We will start with the case of a sequence that both begins and ends with a T. Then the third T has to be adjacent to either the beginning or ending one, so there are only 2 such sequences. Case 2: Then there are sequences that begin or end with a T (but not both, so we don't overlap with Case 1), and have a T adjacent to the beginning or ending one. These two adjacent Ts can be in 2 positions (beginning or end of the sequence) and the third T can be in any of 6 other positions (including adjacent to the other pair of Ts, but excluding the other end), so there are 2 * 6 = 12 such sequences. Case 3: we can also have a sequence starts and ends with T, but not both, and with an H adjacent to that beginning or ending T. The other two Ts would have to be adjacent to each other, and since they would not be at the other end of the sequence (again, to avoid double-counting with case 1), they would have 5 possible positions as a pair. Since the solitary T can be on either of 2 ends, there are 5 * 2 = 10 such sequences. This gives us a total of 2 + 12 + 10 = 24 sequences.