There are a few techniques you can use to make your day run as smoothly as possible without involving puppy prison—but expecting the day to run as smoothly as it had pre-puppy isn't setting yourself up for success, so remember to keep your expectations reasonable.
1. Restricted access.
Whether by puppy gate or play pen, limit your pup's access to busy, food-related areas. Try to place this safe area somewhere near the action so your pup doesn't get lonely and may get the occasional pet or play, but out of the way enough so it's not a safety hazard. Use whatever time you have between now and Thanksgiving to build value for this safe area, using toys, chews, and nice treats to make that area seem super awesome and a great place to be in your pup's eyes.
2. Tire him out. Giving your pup is still quite young, I want to preface this by saying not to overdo it, especially with the physical stuff. But some good mental stimulation before the event and at regular intervals throughout should keep your pup entertained and reduce barking and destructiveness. Puzzle toys, nosework, trick training, snuffle mats—these are all great ways to get your pup to use his brain.
3. Self play. Give your pup something exciting and novel for self play. A new chew toy, long-lasting treat (like a bully stick), or a self-play puzzle toy will help to stave off boredom.
4. Regular potty breaks. Set a regular alarm on your phone/watch/whatever to take your pup out for a potty break, and maybe even a short walk around the block. Preventing potty accidents will make your day smoother and his day less stressful.
5. Enforced naps. If you aren't already, try to get your pup acclimated to going into the crate for nap time. You don't have a lot of time between now and Thanksgiving, so hopefully you've made a start on this already. Figure out how much your pup will need to sleep and enforce those naps by bringing him to the crate for nap time. Little treats when he goes in on his own can go a long way to making it a place he wants to be to sleep.
6. Find your dog lovers. If any of your guests love dogs, have toys available for them to interact with him (in a safe place away from the kitchen!). Tug toys, flirt poles, treats—whatever he's into when you're interacting with him. Keep an eye on your pup though to make sure he isn't getting over-stimulated or over-tired. Make sure your guests (particularly children!) are advised not to over-stimulate the puppy. With children, ensure they're supervised for their safety and your pup's.
7. House line. If you do choose to have your pup out and about, put a leash on him with the loop cut off (so it doesn't get stuck on furniture) so you can easily get him out of trouble. You can even attach it to yourself or another family member so the pup is always supervised.
More long term, but working on calm behaviors like "settle" and "place" can give your pup a place to be and enjoy being relaxed around people. Though four months old is too young to expect a stellar "place" command, it's not a bad idea to start!