A Bhikkhu is restricted to max. three nights sleeping under the same roof with lay-people, better Non-Bhikkhus (which incl. novices and some Nikayas incl. animal as well).
"Under one roof" is also seen often differently, sometimes technical in regard of roof seen, sometimes as matter of touch each other ("privacy"), as the origin story suggest that it's a matter of danger of lose of respect toward monk(s) if seeing ordinary things while he sleeps...etc.
As for the practice (for those in training) it's actually not good for Bhikkhus (but also for others after Paths/fruits) to spend even short time in near association with "non-likewise" or "lower".
It's how ever great goodness if a mature Bhikkhu let a non-Bhikkhu dwell near for a while.
General is near association, living near, with householder and real novices not good and often encouraged to avoid by the Sublime Buddha, not to speak of improper association or dependency.
[Note that this isn't given for stacks, exchange, other world-binding trades but for escape from this wheel.]