In Spaceballs, the big familial twist happens during a confrontation between Lone Starr and Dark Helmet, when the villain proclaims: "I am your father's brother's nephew's cousin's former roommate."
Lone Starr replies, of course, "So what does that make us?," to which Dark Helmet answers, "Absolutely nothing, which is what you are about to become."
Gag over? Not so fast. Over on Reddit, user theyusedthelamppost connected the dots, and realized that most of the connections Dark Helmet lists could, conceivably, cancel each other out — meaning that Dark Helmet is actually Lone Starr's former roommate. As the user explained: "For whatever reason, Lone Starr doesn't remember his past but Helmet does know that these sequence of connections are legit. Helmet is purposely being obtuse (for the sake of comedy) by adding in extra offsetting steps in the connection." If you draw out a family tree, as theyusedthelamppost did, the chain of connections legitimately does point toward theyusedthelamppost's theory being accurate.
Other users argues that just because the connections could work out that way doesn't necessarily mean they do. As user MicooDA pointed out, "It could also be one of Lone Starr's other cousins, if he has any."
That said, for the sake of humor, it's funnier to assume they were former roommates. One possibility, as fanartaltmanfartsalt explained, is that they might have shared a college dorm: "Lone Starr spent his time inebriated/partying, and thus was never really home unless he was sleeping off a hangover." Another user, jackaline, suggested an even tenser living arrangement: "I can totally see a jackass Lone Starr making fun of his nerdy roommate and just ignoring his existence to the point that he doesn't remember how he might have forced him to seek the dark side of the schwartz so he could get his revenge."
If Spaceballs 2 does ever come out, this seems too good an opportunity to pass up.