It is legal if the combination does not exceed the size limits for the place it is being driven. One piece is a truck, another is a trailer. There are well known size limits for trunk highways, varying state by state. There are lesser limits for specific streets and roads, in states where localities have authority to set limits.
For road legality, doesn't matter whether or not you can live in the vehicles.
Whether or not you need a CDL depends on what you are doing with the vehicles, not what kind of vehicles they are or how you combine them. RVs are presumed in most states to be private, non-commercial vehicles. Some states require you to get a different class of non-commercial license for assorted weight and length combinations. In most states, this is much larger than a typical class C, or the TT a class C would be rated to tow.