Logistics, power and hesitancy is the deciding factor.
I reckon you'll save 10% - 25% of the industrialized world, and no more than 2% of the non industrialized world. Total no more than 400 million people.
To save a population you'll need:
Step 1. Start with a shelter exterior. Either:
- Dig an underground complex.
- Dig a big hole and cover it.
- Find a large pre-dug hole (a mine).
- Find a natural hole. A cave. Introduce a salt deposit to water. Etc
- Build a massive concrete above ground structure.
- Start with existing underground shelters. Car parks. Or subway lines, etc.
- Dome a city
This is the easy bit. (link to previous answer coming soon) For a previous answer I showed there's a multiple mines in Australia that will accommodate all Australians with their own apartments.
Step 2. Strengthen it.
I don't think you're going to have issues with cost or capability here, most countries can build reinforced concrete or build earth-quake proofing, and have enough spare finance to borrow to cover that.
I think you'll have issues with supply chains (similar to covid19 with early shortages of testing reagents or masks). Only so much rebar and concrete can be made at once, and it can only be moved and cured so quickly.
Step 3. Power it.
5 years of power is hard. Non nuclear nations are going to struggle obviously, but countries with nuclear power are going to struggle to create safe reactors underground with only 6 months notice.
Building the shelter near an underground coal or methane vein, and venting the fumes from an underground generator, is plausible, but a lot of the easier fuel has already been extracted, and that co2 will be there for you when you emerge.
Non nuclear powers could create geothermal power. Setting this up in 6 months is borderline plausible at best.
I suspect the ultimate winner will be reinforced above-ground existing nuclear power plants able to run on near-auto mode. Some flooding protections after Fukashima should help them survive the tsunami.
I expect a few nations will be able to succeed using different methods each, but most will fail and loose life support.
Step 4. Set up life support.
Building underground greenhouses, oxygen recyclers, water filters, etc is a lot of work, but not beyond the capabilities of any large industrialized country.
I don't think anything here is going to trip up most world powers.
Step 5. Move people into it.
Some countries wont be able to literally get their populations to the shelters in time. Australia's 100 thousand buses could get 25 million people to their shelters in 10 trips. With average 7 day round trip to a converted mine and 25 people per bus, that's over 2 months just to get the population to the shelter.
India has 1.6 million buses for 1.4 billion people, that's 4 times the number of trips. Country is smaller but roads are lower quality, assuming average 5 days round trip to get to the shelter, that's 175 days to move the population. That's nearly the full 6 months, not everyone is going to make it.
This also brings up the problem of hesitancy. Looking at those refusing to mask / take vaccine / etc with covid, it's fairly unlikely 100% would support the plan. Many places politicians would refuse to spend money, dooming their entire population.
So who survives?
Europe: Decent chance of getting their act together. Probably using existing nuclear power or fossil fuel deposits. I'd expect to see 25%+ of citizens surviving from western Europe and the UK. Coin toss for each other country.
China: They have big dense cities that could be domed and huge industrial capability and nuclear power right near the cities. If anyone could dome a city in 6 months it'd be China. I'd expect 25%+ of Eastern China to survive.
North America: This will be state or wealth based. All the billionaires will have their own bunker. Some more populous US states (and most Canadian) will be able to build their own bunkers but I'd expect many states (especially those "small government" states) to fail.
Most other industrialized countries have a decent chance.
Most non industrialized countries will give it a go, and some will get lucky, but the odds aren't good.