“Those are the people who had been living in the mansion for a year.”
- The people are still alive.
- They are not living there anymore.
“Those are the people who had been living in the mansion for a year.”
I find your question to be clear - "Could this sentence be correct?"
My answer is yes - it could be correct, if you are indicating a group of people who lived in the mansion for a year, but who are no longer living there. However, as a native (American) English speaker, I would say the same thing this way:
"Those are the people who lived in the mansion for a year." (same idea, less wordy).