Yellowstone is absolutely massive and requires a ton of driving as is. Stay inside the park if possible to avoid adding extra hours of driving each day. Also makes it easier to avoid peak crowds and to see wildlife. Get out exploring early, siesta at camp or wherever midday, and then get back out late afternoon/evening.
Staying in the park isn’t critical for Tetons, but it’s basically there or Jackson as your options. You can hit some of Teton as you leave Yellowstone one day, stay wherever for a night, and see some more the next day.
Book ASAP. The in park options fill up quickly.