Bunkers, and luck, that or keep the number of nukes low.
Although to be honest, 1 billion people is still quite a lot to survive a nuclear apocalypse. Between two powers that don't have very many nukes, like your example with India and Pakistan which only have an estimated ~100 nukes between them, I could see 1 billion people surviving, bunkers or not. Probably not in India or Pakistan, but there are a lot of people spread out in the world. It's hard to kill that many people over such a large area. It's going to be rough for a bit as the nuclear winter that follows a minor nuclear war would cause famines, somewhere, but 1 billion people could survive if they are far enough away, and the number of nukes deployed are small.
However, if there was nuclear war between, I don't know, Russia and the US, no way anyone is surviving that many nukes on the planet. There aren't enough bunkers for 1 billion people. A few thousand maybe, likely wealthy people and key world leaders' offices. Rebuilding is maybe possible, but I think it's unlikely. You would have to have food for a long time in your bunker, and then have the knowledge and manpower to rebuild society after you leave said bunker. Human pockets would emerge from their bunkers, at most a few hundred at a time. A few thousand humans spread over the vastness of the world, it's hard to say if humanity would be able to make it back to our current day population. (All of this assuming that literally nobody outside or at least no major centers of humanity survive, which it's likely that a few cities survive, like somewhere in New Zealand, Greenland, Iceland, or any small area that is both far from any major nuclear targets and not a target itself could have a chance to survive, assuming they find a way to produce enough food for themselves for a long time).
Nukes are hard to survive, and the consequences after the bombs have stopped falling even harder to survive, but humanity is persistent. We have made it this far. Even reducing our population to a few hundred thousand, we can likely bounce back from. So, to answer the question of 'how humanity will survive nuclear war' is not that hard. Just don't kill all of us at once and don't fire thousands of nukes at each other.