As far as I know in Chinese sentences we should use adverb after subject and before the verb. For example: 我在上网聊天儿。
So can I say 我(S)在北京(adverb)住(verb)? Why do we say 我住在北京?
Generally speaking, the two structures
where「L」is a location and「V」is a verb done at「L」are used for different purposes.
我V在L is normally used for stative verbs, that is, verbs which describe a state of being rather than an action. For example:
我在LV can be used for other kinds of verbs, including stative verbs, so 我住在北京 and 我在北京住 are both acceptable.
Dynamic verbs are not normally of the structure 我V在L, so e.g. expressing I'm eating at home as 我吃飯在家裏 is non-standard.
我(I) 住(live) 在 (at/in)
住(live) is a verb; 在(at/in) is a preposition for the noun (some place) to follow. Their order cannot be switched
We don't say "I at live (somewhere)" or "I in live (some place)" in English. For the same reason, we only say "我住在某處(some place)" but not "我在住某處(some place)"
In "我在北京住", "我住" is the subject and verb, "在北京" is the adverbial phrase for the verb.
'在' in '在北京' is the preposition for the noun '北京', not for the verb '住'
You cannot remove '北京' in "我在北京住" and write "我在住" because the preposition '在' has to be followed by a noun, e.g. "在某處 (in some place)" ; "在北京 (in Beijing)"
submitting 在北京住 to online dictionaries, e.g. iciba shows it to be correct:我们曾在北京住过一段时间,他在北京住了很多年了,我已经在北京住了七年了,just as 住在北京 is correct, when before verb 在{某处所,e.g.}北京, functions as adverbial (状语),when following verb it functions as complement (补语),similarly as for 在[某时间] (see many examples for both placements with 在[某时间] at When is it appropriate to use 在 with a time phrase? (3rd/longest answer) (examples may suggest that 住在北京 is more common than 在北京住, if 住 is not followed by aspect particles like 了,着,过 (and time complements),
In the sentence
我住在北京
The "在北京" is a something called a "location complement". You can read more about them here.
However, if you just want an easy way to remember how to correctly form sentences with 住, follow this rule: If you just want to say where you live/lived, use the structure 我住在. If you want to say how long you lived there, or communicate that you have had the experience of living there (using 过) then use the structure 我在...住. The same rule of thumb applies to similar verbs like 躺,坐,站 etc.
Hope that helps.
Excerpted from section 9.3.8 of A Chinese Grammar for English Speakers (汉语语法指南, 英文版):
However, 在 takes a post-verb position when occurring with certain verbs, and we may roughly divide these verbs into three groups...
- ...appearance or disappearance... (出生, 出现, 发生, ...)
- ...arrangement, placement, and displacement... (安排, 藏, 掉, ...) This case covers 住, although the book does not include it in the examples.
- ...body position and posture... (睡, 站, ...)
The book has multiple full sentence examples, covers other uses of 在, and also compares it with 于. I highly recommend it as a reference for these sorts of questions. The only obstacle for beginners is that 汉字 in the running text do not include pinyin. That is only provided for full sentence examples.