I bet noedne's answer is the intended one, but I suggest that another that (less interestingly) fits everything is
that they are two prisoners in solitary confinement in the same prison.
Two housemates lived in close confines
Perhaps they are even kept in adjacent cells.
yet never crossed each other's lines
Only allowed out rarely, never allowed to see anyone else but prison staff.
Within the same walls for nearly a year
Solitary confinement sentences can be anywhere from a few days to many years.
they dwelled without even sharing a beer
Prisoners in solitary aren't allowed to see one another. Also, not much beer in a typical high-security prison.
Most of their time was spent in the vicinity
As I said above, perhaps even adjacent cells.
they had private rooms but they shared amenities
Things like toilets and medical facilities may be shared.
Yet despite spending so much time in the same place
they didn't so much as see each other's face.
Again, prisoners in solitary aren't allowed to see one another.