David is Josh's older brother who goes to the University of Washington. Before he left, Emma explains that "he was always a fun person to have in the neighborhood" (5.32), giving us the impression that he's a good guy.
Josh stumbles across David's future Facebook and discovers that David is gay. He's shocked by this because David has never given this impression, though Josh thinks this may explain why David moved so far away from the family—you know, to claim some space to do his own thing.
Just because he's not physically close, though, doesn't stop David from being a mentor to Josh. When Josh is freaking out about Sydney and Emma, he turns to David for advice, and when he does, we see that David knows his brother well. He tells him, "sometimes you need to figure out what you want, Josh. If that means you need to swim against the tide to get it, at least you're aiming for something that could make you very happy" (55.53). Hey, wait a second… It sounds like David just might be speaking from experience here. No matter, though—this is just what Josh needs to hear.