Spells that deal thunder damage, or where you can make an initial choice at the time of casting to have them deal thunder damage, qualify for Heart of the Storm.
Jeremy Crawford addresses a similar, more specific version of this question here:
Twitter user: If a Storm Sorcerer casts Dragon's Breath and chooses lightning as the damage type, does that initial casting trigger the extra damage from "Heart of the Storm"? PS. Love Xanathar's, it's a perfect addition to 5e!
Crawford: Yes, dragon's breath can trigger Heart of the Storm if you pick lightning. ⚡️
As for the edge cases where the damage type is undetermined at the time of casting, I don't think there has been any official ruling. Since Heart of the Storm activates when the spell starts being cast, I don't think spells like Chaos Bolt would qualify.
I'm not sure about Storm Sphere, since it is capable of causing lightning damage but only if the caster uses a bonus action after the initial casting (while concentrating) to do so. I would have argued against it qualifying because the initial casting doesn't cause the damage, but then neither does Dragon's Breath, and Crawford says that spell qualifies.
Absorb Elements seems more likely to qualify; its damage type is, in fact, determined when the spell is cast, so as long as it's cast in response to lightning/thunder damage, it should qualify for the feature.
Yes, Demon Lords
In the recently released Mordenkainen's Tome of Foes, there are several extremely powerful enemies. Amongst them are the Demon Lords, creatures of near-deity level power. An example of this is the Demogorgon found on page 144. Amongst their damage immunities, demon lords have the following immunity (bold added):
bludgeoning, piercing, and slashing that is nonmagical
Note that this is in contrast to the similar resistance or immunity that other creatures have to:
bludgeoning, piercing, and slashing from nonmagical attacks (MToF, p. 132, bold added)
And note that, as stated in the PHB on page 183 (bold added):
At the end of a fall, a creature takes 1d6 bludgeoning damage for every 10 feet it fell, to a maximum of 20d6.
Thus, if the Demogorgon was somehow subjected to a fall, it would take no damage, since the bludgeoning damage from a fall "is nonmagical."
Best Answer
The Sleep spell might work
If you are asleep, you are unconscious. If you are unconscious, you are incapacitated. (Conditions, App. A, PHB, p. 292). If you are incapacitated, you cannot concentrate.
The trick is to push/shove/drag the creature away from any other creature (20' or more away) if it is near other creatures (including your party), and then cast sleep at as high a level as one can.
One way to do that is cast a bunch of Eldritch Blasts with the Repelling Blast invocation, that hit (no damage, but target shoved or moved for each blast that hits).
Have your Barbarian grapple, Shove/drag/pull the target, and hope that the Barbarian has more HP than the target.
At that point, cast sleep at as high a level as one can. Roll 5d8, and an additional 2d8 for every spell level expended above 1. Let's use a 5th level sleep to illustrate.
Roll 5d8 + 8d8 = 13d8 which is an average of 58.5 HP. (At 7th level, 76.5).
Depending on how you roll and how much damage the target had already taken before it put up invulnerability, problem solved. If not, it was worth a try.
At higher levels, Power Word Stun
If you have access to 8th level spells, a successful Power Word Stun will incapacitate a creature. That solves the problem.
Paralysis / poison, or using a magic item, etc
Depending upon what you have available to you, anything that can inflict the paralyzed condition incapacitates the target. Various poisons can incapacitate or poison a target: Torpor(incapacitates), Essence of Ether (renders unconscious), Oil of Taggit (renders unconscious, Crawler Mucus (paralyzed). A Wand of paralysis will, if the Con save is missed, achieve that aim.
Get a Monk Involved
Even though the attack will do 0 damage, a monk attacking with Stunning Strike will stun the target. Once stunned it is incapacitated and Bob's your uncle.
PHB p. 79 (Stunning Strike)
I am pretty sure that a Sorcerer's Empower metamagic won't allow the HP amount to be boosted when casting the sleep spell (by re-rolling low numbers), so I asked a question about that.