When you first put them out in the coop they need to be taught to sleep in the coop. This means coming out right after dark and placing them in the coop (and locking them in it for the night too at times). They will learn to sleep in the coop after a while. For the roost, they will also learn and it does take time. It took about a month for all of mine to sleep on the roosts.
