Baby keeps falling out of bed!

I’m so scared for my baby . My baby fell off the bed atleast five times in the past month. He just recently fell out of the bed because he called from where he was laying and fell. My bed is at least 16 inches of the hard carpet floor He co sleeps with Me and my boyfriend. & lately We tried to introduce the crib with him but he will cry for an entire hour until we take him out the crib i honestly don’t know what to do