Democrats can live wherever they want. Maxine Waters lives outside of her district...
Rules are different for federal vs. state. To get elected to Congress, you merely need be a resident of the state your representing. For state legislatures, you usually have to explicitly live within the district lines of the seat you’re running for. That’s why gerrymandering was often so ruthless that it wasn’t unknown that the majority (usually Dem) would draw the lines around the home of an incumbent or challenger to disqualify them from running (or forcing them to go house-hunting for a new residence within - a pain in the ass, especially if you’re not wealthy).