Chandler and Ross were college roommates.
Rachel lives with Monica from episode 1.1, when Rachel decides that's where she's staying after leaving Barry at the altar. The flat actually belongs to Monica's grandmother, who moved to Florida. Mr Treeger threatens to evict the girls for illegal occupation of the flat in episode 4.4.
Chandler lives opposite the girls with Joey from 1.1 onwards except 2.16 when Joey moves out because he is more affluent due to Days of Our Lives and because Chandler caught him licking a spoon and putting it back in the drawer. Eddie moves in with Chandler in episode 2.17 but he turns out to be arguably the maddest character ever on Friends, beating even Mr Heckles. In any case Joey and Chandler miss each other, and Joey moves back in in episode 2.19.
Phoebe used to live with Monica before she went to live with her grandmother.
Ross lives in a flat which he shared with his wife Carol before she officially became a lesbian. Chandler and Joey help him build new furniture in episode 1.1 after Carol has moved all her things out.
Ross moves in with Chandler and Joey in episode 5.7. He had moved out of his flat to get a new place with Emily (who wanted a clean start in a new place with no traces of Rachel) but when his marriage ended he had nowhere to live.
Rachel and Monica lose their flat to Chandler and Joey, (not sure when) but get it back by kissing each other for one minute.
Most of Chandler and Joey's furniture is stolen in episode 4.2.