The research was conducted using the profiles of 12 million users between the ages of 27 and 71 (made available by Facebook) and vital records provided by the California Department of Health. Users with average-to-larger networks of Facebook friends had a lower mortality rate, as did users who used the site "moderately."
Facebook activities implying that users interacted with their Facebook friends in real life (like posting and tagging friends in photos) were also associated with lower mortality, while more passive, online-only interactions (like sending messages or liking posts) had no effect. Similarly, receiving a lot of friend requests was associated with living longer -- but sending out friend requests was not.
Clearly, it's not just Facebook itself that's making people live longer. Meeting new people in real life (who subsequently add you as a Facebook friend) and actively maintaining your friendships (face-to-face and online) is the key here.