The protagonist is a legend because he was the last survivor, but he is no longer alive. Legends are people who have made an impact on the world they left. While alive, he was a legend because he was the only living human and he was trying desperately to save the world from vampirism. After death, his actions left a legacy. His legend is that he no longer exists and the world he lived in no longer exists.
The story in I Am Legend is one in which a society completely transforms. Told mostly in flashback, we learn that a plague caused humans to turn into vampires. Robert Neville is the only human in a world of vampires, because he did not get the infection turns people into vampires. He hunts and kills vampires during the day and staves them off at night. When he meets another human, Ruth, he is suspicious of her. He soon learns that there are others who have found a way to control the vampire disease. This new group plans to kill all of the vampires and anyone else who is a pure human. Eventually Neville is captured and Ruth helps him commit suicide rather than being executed. As Neville dies he realizes that he is, in fact, the legend.