Whining is an indication of stress. Sourcing the stress from the dog's point of view can sometimes be difficult. Think about what is going on when he whines and try to eliminate thst stressor or redirect him. Whining can become habitual and it can be very hard to extinguish.
Redirect him to a toy or get his attention doing a little clicker training for fun (like 101 things to do with a box).
Redirect him to a toy or get his attention doing a little clicker training for fun (like 101 things to do with a box).