How long has he done this? Has he always whined, or is this a new behavior?
I'm guessing he's whining just to get your attention, and it probably works, even if it's just you looking at him or telling him no or quiet.
I would start completely ignoring him when he whines. No talking to him (you should only have to tell him "no" or "quiet" once), no looking at him, no nothing. If you have to, put him in time out, in a room away from you until he is quiet, which may take awhile. Let him back out when he stops whining. Since it sounds like he may have been doing this awhile, it may take awhile to get him to stop doing it.
He may also have a bit of separation anxiety in there too, but since he is also whining when your'e there, other factors apply as well.
I hope others have some suggestions for you as well. Good luck in whatever you decide to do.