Yes, Thanos dies, too, but it takes a while. The past version of Nebula opens the time travel portal so that the past version of Thanos can travel into the future, too (Thor beheads Infinity War Thanos at the very start of Endgame, FYI). He blows up the Avengers compound and faces off against Thor, Steve/Captain America, and Iron Man as his men search for the Infinity Stones, which the Avengers succeed in collecting. Hulk is able to wear the gauntlet and snap all the heroes who "died" from Thanos's snap in Infinity War back into existence, but loses track of the gauntlet in the explosion.
Toward the end of the battle, all that stands between Thanos and victory is Tony, who steals the stones from Thanos at the last second. Tony assembles his own gauntlet and snaps, making it so that Thanos and his army disintegrate the exact way the Avengers do at the end of Infinity War. The lavender villain is the last to die, forced to watch his men disappear all around him and come to the realisation that he's truly been defeated. Justice, served.