I think your question is 住在(X) vs 在(X)住介词.
在:可用作介词,表示事情的时间、地点等[in;on;at],在 should follow with time, location
Just like BingLee said 在住X is wrong.
You can say 我住在北京三个月了 and 我在北京住了三个月。These two are all right. But there are still some tiny differnces between them.
1)我住在北京三个月了, means you are still in BeiJing.
2)我在北京住了三个月, maybe yes maybe not depends on the context
Because we don't have tense in Chinese, so sometimes we use function word such as 了 to express.For example, 吃饭了about to have dinner ,吃了饭had dinner.
Hope it helps.