Roughly 10-14 days and, due to teenage girls, very little "roughing it"
As you may have gathered from all the great suggestions so far, be realistic about what you will be abele to see in 2 weeks. That preliminary route is a LOT of ground to cover. Utah alone has 5 national parks, so resist the urge to see "everything" and build a list of things you'll want to see and explore on return trip(s). Since you mentioned that Yellowstone and Glacier are already on your list, I'll focus my advice on those. I also happen to be most familiar with those two parks since I live about 2hrs north of Yellowstone.
First, time your trip correctly for Glacier. You don't want to plan a first-time trip to Glacier without driving the Going-To-The-Sun Road. For 90% of tourists, the GTTSR is 90% of Glacier. The snow-clearing process for the GTTSR road each spring is a herculean effort that often is not completed until late June or even early July. Don't arrive in Glacier in mid-June expecting the road to be fully open. I hate visiting the western national parks around July 4th, but for Glacier, that's really the earliest you can visit and be virtually guaranteed the road will be open.
Normally, you want to drive the GTTSR from west (Columbia Falls/West Glacier) to east (St. Mary). But be aware that last year, the Blackfoot Nation never agreed to open the east side entrances to the park for covid reasons. Everybody had to enter and leave the park from the West Glacier entrance, so that meant making a U-turn on the east side of the park at Rising Sun and doubling back. It wasn't a huge inconvenience, but you don't want to enter the eastern side of the park needing gas and/or food. Nobody knows yet what entrances will be open on the east side of the park for 2021.
For Yellowstone, don't make the mistake of seeing Yellowstone but skipping Grand Teton National Park. Grand Teton doesn't require a huge time commitment to experience "most" of it's grandeur and it is spectacular. Personally, instead of picking West Yellowstone, Jackson, or one of the other "gateway" cities as a base of operation, given your limited time, I would plan my trip so that I spent a night in one of the gateway towns with the next night in a different gateway town so that I could spend the next day slowly making my way to our destination that night without having to double-back at some point.
So, for example, if you had two full days in the Yellowstone area, I would suggest something like this: arriving your first night in Jackson, setting out early the next day to see Grand Teton NP, making your way up to West Thumb, Old Faithful, Grand Prismatic Springs and the Firehole River, spending the next night in West Yellowstone. For Day 2, hit Gibbon Falls, Norris, Canyon Village/Yellowstone Falls, Lamar River Valley, and make your way out of the park through the northeast gate near Cooke City and drive the Beartooth Highway up to Red Lodge, MT where you'd spend the third night. DO NOT go to Yellowstone and fail to drive the Beartooth Highway from Cooke City to Red Lodge. It will be one of the highlights of the trip. If you have a 3rd full day to spend in the Yellowstone area, consider spending it in Gardiner, MT at the north entrance and use the day to see the Mammoth Hot Springs and Yellowstone Lake portions of the park.
When you make your way from the Yellowstone area to the Glacier area, go via Missoula. The headquarters of the Rocky Mountain Elk Foundation right off the interstate in Missoula makes for a convenient rest stop with some pretty impressive displays and a gift shop. It's also right beside a Cracker Barrel in case you need a states of the South at that point. On your way from Missoula to Glacier on Highway 93, the National Bison Range near Ravalli is worth-while detour for a couple of hours, if it is open (it never opened for vehicles in 2020 due to covid). It's a scenic one-way gravel road that offers some great views, and lots of wildlife (bison, bighorn sheep, elk, mule deer, and some black bears).
As somebody mentioned above, getting up early each day is highly recommended in the national parks. I know that might be tough with two teenage girls, but the West Yellowstone entrance to Yellowstone, especially, can get pretty crowded by about 8:30am. If you can avoid the crowds between the West Yellowstone and Madison Junction choke-point, you will have more fun that day.
Lastly, as far as timing, be aware that August is the fire season in the west. For 3 out of the last 5 years, wildfires and smoke have had a pretty significant impact on the outdoors experience out here in August. That can mean August can vary from rather hazy to downright smoke-filled, depending on how close the closest wildfires are to you. Or, it might not be smoky at all, but it's something worth thinking for planning purposes.
Oh, and I assume you are flying in somewhere, maybe Vegas, and renting a car? If so, it's worth a stop at Walmart on day one and picking up one of those styrofoam coolers and sandwich materials, snacks, etc. Given the places you are going, there will be times when stopping at a pullout and eating sandwiches will be much more pleasant and efficient than finding a restaurant where you all can eat. This is especially true in the national parks where dining options were very limited last year with the covid restrictions. Even if things are back at 100%, the picnic lunches are convenient ways to avoid the crowds.