"If 6 boys can build 24 birdhouses in 2 days," it means that the rate of work is
= 2 birdhouses per one boy per day.
Now it should be clear to you that the answer to your question is
= 5 days.
If you want to see more solved problems/samples of that kind, look into the lesson
- Rate of work problems
in this site.