I think I can get up to 9 permanent immunities, and then 3-4 temporary immunities, plus resistance to force damage cause why not.
Race:
- Yuan-ti Pureblood (Volo's Guide to Monsters) - Immunity to Poison
Class:
- 10 Levels in Artificer, subclass doesn't matter but Armorer might help
- 10 Levels in Bard, choosing the College of Lore subclass
With the 10 levels in Artificer, you'll get Magic Item Adept, which allows you to attune to up to 4 magic items at once. This is important, because we're going to pick:
- Shield of the Uven Rune - Immunity to Cold
- Armor of Resistance (Artificer Infusion) - Resistance to Acid
- Black Dragon Mask - Immunity to Acid, since we have resistance from the armor
- Absorbing Tattoo, Force - Resistance to Force, with the ability to gain immunity to it once per day
Since we're level 20, we can also get:
- Boon of the Fire Soul - Immunity to Fire
- Boon of the Stormborn - Immunity to Thunder & Lightning
And, last but not least, all we need to do is contract Lycanthropy, which gives us Immunity to Bludgeoning, Piercing, and Slashing damage from weapons that aren't silvered.
This totals up to 9 permanent immunities.
As for the temporary ones, since we're a 10th level Bard, we get Magical Secrets. Multiclassing means that while we're only level 10, we have 8th level spell slots. This means we can take the Mind Blank and Tasha's Otherworldly Guise spells.
Mind Blank gives us Immunity to Psychic damage for 24 hours, and Tasha's Otherworldly Guise gives us Immunity to Necrotic and Radiant damage for one minute. Additionally, if you wanted resistance to them in the meantime, you can use one of your Additional Magic Secrets, since we're a College of Lore Bard, to take the Hallow spell. While within the area, creatures you designate can have resistance to one damage type of your choice.
With these spells, and a single turn of Immunity to Force from the tattoo, that gives us the 4 temporary immunities, meaning that for six seconds, the only thing in the universe that can hurt you are silvered weapons.