Baby tossing about 5 months

g

My baby used to toss about and lift his feet up and bang them on the cot at 3 months then for about a month he stopped and it was great I slept great, now at 5 months he sleeps great for 2 hours then the whole rest of the night he does this thing. I can’t sleep through it but if I leave him long enough he starts crying but his eyes are always shut I have no idea what I should do ! I had to put him in bed with me last night to get like 2 hours sleep - any suggestions?