In general techo is used, as you say, for both "roof" and "ceiling". We only try to make a distinction when necessary.
Cielo raso or cielorraso is a bit technical, but common enough in my experience. Raso means "flat and smooth" but cielo raso is often understood as a ceiling in general, provided it's a more-or-less continuous surface.
About a good way to say in Spanish:
The top floor of my house does not have a ceiling under the roof.
Since the sentence itself says there's no ceiling, you can treat this in a general way and say cielo raso, which is the most common kind of ceiling. If you do this, then techo should be enough to express "roof", since the contrast should be obvious. If that's not good enough, you could add some detail about the roof; for example, you refer to the beams or rafters (vigas) that support the roof, which should be hidden by the ceiling if there were one:
El piso de arriba de mi casa no tiene cielo raso bajo las vigas del techo.
This is a bit awkward; some people would say something more like
El piso de arriba de mi casa no tiene cielo raso, se ven [directamente] las vigas del techo.
that is, "one can see the roof-supporting beams [right away]".
For your last question, yes, techo can be used to denote the ceiling of a room on any level of a house.
Something that you didn't ask, but that you could find useful, is about collocation and ambiguity. With techo, if you say subir al techo, that basically always means "to go up on the roof"; it never means "to climb [a ladder] so that you can reach the ceiling". If you want to express this latter meaning you need to express it in a different way.
If the roof is flat and/or meant to be walked on, you can call it a terraza. If it's sloped and has tiles, it's a tejado. These are two alternative, more specific ways to refer to a roof, if doing so using techo would be ambiguous.