I think it's more about which of their years were spent on other teams.
Jordan spent all his relevant years on one team, same with malone. Kareem split his best years between two teams, same with LeBron...
Shaq spent his early years with orlando, his peak years with the Lakers, his downturn years with the Heat and then hopped to 3 other teams for a year or so each... he should have retired after the heat I think and his career would have been looked at more positively down the stretch. The end reeked of desperation, like he couldn't just let it go when he knew he couldn't bring it anymore.
2-3 teams is the max I think, but context also plays a big role.