Do you ever get to visit with your grandchild? It might be helpful to gently ask questions about the living arrangements to better understand his perspective. You can ask “what is your favorite thing about mom’s house, what’s your favorite thing about dad’s house? What is the worst thing about mom’s house, what is the worst thing about dad’s house?” These questions should be very matter of fact, like of course there would be good and bad wherever you go. Just listen, see if you can learn something about how he is feeling about the situation. Does he miss his mom, his dad when he’s not with them? Acknowledge this must be hard.
If your daughter can understand him better, it might be easier for her to know what to do. In general, all parents of young children should develop a routine that is clear. It doesn’t have to be exactly the same everyday, but there should be some aspects that are consistent and fun, like meals, bedtime and hygiene routines, etc. When he gets to her home, she can explain what the plan is for the day and/or the weekend, and provide reminders along the way to help with transitions, “after breakfast we will go to the park”, “we will be leaving the park in five minutes, let’s get ready.” If he has trouble, she can acknowledge the feeling, “I know it’s hard to leave the park”, but also stick to the plan, “but remember we are going to dinner with Grandma when we get home.” If he doesn’t cooperate, put her arms around him, tell him how much she loves him and how important it is to listen, and help him along. Being playful can help with most things, “let’s see who can get to the car first.” Keeping listening fun at this age builds good listening habits for the future.
It also might help, if mom and dad are on good terms, if they can spend a couple of minutes at the beginning and end of the visit to discuss the plan. Dad could say something to mom about how his week has been, “he’s had a good week, spent some time playing with his friend and listened well at school”, and then to his son, "hey buddy, have fun with your mom, I’ll see you tomorrow.” Same when he returns to dad, mom can say “we had a lot of fun playing with grandma”, and “hey buddy, have a good week with your dad, can’t wait to see you next weekend.” They should keep it positive, and resist any temptation to complain about his behavior. His behavior will improve when he feels safe and secure in his life.