Compatibility question I was wondering on a mountain bike what rear derailleurs work if have a 21 speed bike.

Additional information: 7 ring rear cassette and 3 in the front 

Will an 8 and 9 speed rear derailleur work or how would i go about this getting a rear derailluer in that condition?
I would say any 8 or 9 speed will work (same brand), you just need a 7sp shifter. 
The pulling ratio is controlled the by the shifter, so as long as the shifter has the same number of speeds as the cassette you should be ok.