Baby won’t sleep

Lately my son who just turned 5 months old, won’t sleep at night, we’ve been having a hard time getting him to nap during the day as well, but when we put him to bed he’s drowsy and ready for bed (around 8-830) and as soon as we put him down he’s wide awake, and when we walk away he screams and cries, we go back to give him his pacifier and he laughs and smiles and kicks his legs like he wants to play, we give him his pacifier and as soon as we leave he starts screaming again. This goes on for hours and then he’s wide awake again at 2 am. I’m really at a loss and don’t know what to do.