Sleeping in crib

My baby will only sleep an hour maybe two in the crib but if I let her sleep in my bed she will sleep 5 hours straight. How do I get her to sleep in the crib that long. Baby is now 5 months. Any tips that work any advice that I can try.