I am trying to figure out the missing rests in a couple of bars with the time signature 9/8.
I think for the first bar there will be a dotted quarter rest. I am not too sure about the next one. Any hints or directions appreciated.
The time signature 9/8 is used for a compound triple metre, i.e., three dotted quarter note beats (of three eighth notes each).
For the first measure in your question, the first and last beats are filled with eighth notes and only the middle beat is missing. This should be filled by a single dotted quarter rest — as you said.
For the second measure, the middle beat is filled by the dotted quarter note, but both the first and last beats are incomplete.
The first beat has two eighths notes missing. This should be filled in as two separate eighth rests. A single quarter rest symbol is not appropriate here because this rest is not at the start of a beat.
The third beat also has two eights missing, but because these rests are at the start of the third beat they should be combined and written as a single quarter rest.
As stated in Elaine Gould's Behind Bars, p. 163:
[R]ests at the beginning of a beat may be combined.
Rests that follow a beat should expose all three divisions[.]
In 9/8 time, it is customary to notate it as three groups of three beats each. Thus, you are correct that the first measure would be completed by a dotted quarter rest.
Keeping this convention in mind, and observing that the second measure's "middle" three beats are accounted for by the dotted quarter-note, should allow for the question to be answered.
9/8 is equivalent of 9 eighth notes per bar. BUT because the top number is a multiple of 3, those eighth notes are set out in groups of 3 (or equivalents of 3 quavers). As in, the bar could be divided into 3 equal parts.
It's the same with other compound time signatures - 6/8 divides into 2x3, 12/8 into 4x3.
So, now, it's pretty simple sums!