unlatching

At night my three months son would be up for over 6 hours without napping. When I try to give him the breast he would eat for two sec then unlatch then eat then unlatch then start crying and moving his hands and legs. Any idea why he's doing this?
This only happens at night