I had the same issue with my chicks. I don't remember exactly what age but they'd been in there coop for a few weeks and still sleeping in a pile. I discovered this when i peaked in to see what the ruckus was about at bed time. They were jostling for position on the exposed 2 x 4s on the floor. The rooster was higher up on a 2x4. One night, I went in and picked up 2 of the 10 hens and put them up in their roosting boxes. They didn't stay up there but they got the idea. The very next night, a few flew up and roosted. Within a couple nights, they were all roosting.