Killing the final boss, as others have stated, would make sense, except that it doesn't seem to hold completely true. I ran through the Corvega Assembly Plant, killed the final "boss," Jared, and my map never told me it was Cleared. However, after a second trip to the area, after some time had passed, enemies had respawned and I got to kill all the Raiders again, this time, however, the map told me it was "Cleared."
Personally, I hope they leave certain locations in the game un-Clear-able, it's always fun to go back and fight more Raiders. If every location is cleared, there are no more fight-clubs to go and fight in. So far, Corvega and Ironworks are two locations I've explored that never said they were "Cleared" even after killing the final boss.
As a possible theory, it might have to do with the number of missions pertaining to a location. The first time I "Cleared" Corvega was for the quest: The First Step. The second time I went there was for the quest to plant the MILA device at the top for Tinker Tom. After that mission was done, my map told me the location was "Cleared." So it's possible that the locations are labeled Cleared when you've completed all quests that involve the location, but that's just a theory. Highly flimsy at that, as I understand there's a BoS quest that involves Corvega as well.