Rainbows come from a variety of habitats, from shallow streams through to lakes, rivers, and in one or two cases even estuaries. So there's no single rainbowfish habitat. It's worth spending a little time looking over the ANGFA database; they record quite a bit of data re: the environments of most Australian freshwater fish.
If you're asking what they look best, there's no question it's a fairly dark tank with lots of shade, so that their colours become heightened. Lava rock and plenty of tall plants that grow across the top of the tank (like Vallisneria or Crinum spp.) would work nicely. Black sand would perhaps be the best, but plain gravel or silver sand would both work well provided there was sufficient shade. The size of the tank is the critical thing: a school of M. boesemani for example really only looks at home in a big tank with at least 60 cm depth of water and 120+ cm of length to the tank.
Cheers, Neale