If you never give him people food while eating or cooking, he will not beg. It takes time and patience, but it does work.
My dogs only beg off of the family members who have given them scraps. They know they won't get anything off my husband. They know they won't get anything from me while I'm eating, but that I will go put leftovers from my plate into their dish afterwards. They know that our children will feed them.
As a result, they ignore my husband when he eats. When I eat, they will lay on the ground and watching intently, only getting up when I'm done eating to follow me into the kitchen to put something in their dish. When my children eat, they sit right next to them and beg.
If you have children, this is going to require training your children as much as your dog.
(When we tell our dogs to go lay down, they will lay down and stare intently, but do not beg.)
WARNING: This all applies too cooking too. If you give your dog scraps while you're cutting vegetables, the dog will be constantly underfood while you cook. That was my world until I re-trained them to lay on the floor until I put food in their dish. If you hand food from the counter, your dog will always be right next to you and you'll trip over him. If you put it in the dish when you're done with meal prep, your dog will learn to wait patiently. If you never give food while cooking, your dog won't bother you in the kitchen.