For the first one (assuming you can only have an S and a T), you fix the first two which gives ten digits that can vary. If you have 10 digits with two possibilities, this gives 2^10 = 1024 possibilities.
Now if you three T's in the string as a whole then you include the T in the "ST" and you need exactly two more T characters. So you need to find the number of ways of choosing 2 T's from 10 available slots. Have you done this in your class yet?
If you haven't done this, then explain what kind of things you have done and how your teacher explained it.