The UNHCR Guidelines aim to define the principles and practical measures for the protection and assistance of refugee children. UNHCR argues that because detention can be very harmful to refugee children, it must be used only as a measure of last resort and for the shortest appropriate period of time. The same principle applies to alternative accommodation in which children are held under prison-like conditions. Families must be kept together at all times.
Source: official link