Why was the Hulk knocked out so quickly by Thanos in Avengers: Infinity War but was not knocked out after Tony Stark in the HulkBuster drove him straight down through about 30 floors of steel girders and concrete slabs of a building in Avengers: Age of Ultron?
The important thing to note here is Avengers: Infinity War happens immediately after the events of Thor: Ragnarok, as we see in the post credits scene.
This means Hulk goes after Thanos right after an incredibly exhausting fight with Fenrir. A rather even fight, where Fenrir does bite Hulk rather bad.
Add to the picture the fact that Thanos is a very skilled fighter! He excels in hand-to-hand combat. As we see in the fight sequence, Hulk is a brawler who relies mostly on brute strength.
This is supported by this quote from Joe Russo:
Hulk is obviously very powerful but he’s a little mindless in his fighting style. It’s aggressive. It’s pummeling. Thanos is the Genghis Khan of the universe. He’s a very skilled fighter and equally as strong. So when you put those two up against each other, the more skilled fighter is going to win. Which is why Hulk has a moment where he overpowers Thanos, but ultimately Thanos is smarter.
In summary, two reasons:
- Hulk is already exhausted from all the action on Asgard.
- Thanos is a better fighter than Hulk.
The real question isn't exactly how Hulk didn't get knocked out by the building thing.
To put things into perspective, being driven through a building wasn't that much of an issue for the Hulk. He's easily more powerful than that. So that was definitely not going to knock him out.
But going toe to toe against an equally strong, and way more skilled opponent, whilst being driven to exhaustion, was obviously going to put him at a major disadvantage.
EDIT: No spoilers, but Endgame gave us even more evidence to support that Thanos IS indeed just as strong as Hulk, and is even better a fighter than several!