Bunk beds

Ideally how long should siblings of opposite sex share a room? I plan for my children to share at 2 and 5years. I mentioned this to a friend who seemed alarmed. She lives in a mansion though. Lol