[verb] + (了 / 过) + [number] + 次 / 遍 / 趟 / 下
[verb] + (了 / 过) + [number] + 次 + [object]
[verb] + (了 / 过) + [pronoun] + [number] + 次
次, 遍, 趟 and 下 count actions the way 本 or 杯 count things. The number and measure word go after the verb, and after 了 or 过 when there is one.
次 and 遍 often both fit, with a difference. 这个电影我看了两次 counts the occasions; 这个电影我看了两遍 says you went through the whole film twice.
一下 after a verb also softens a request (看一下 "have a look"). That use has its own point.
An ordinary object follows the measure word. A pronoun goes before the number. A place name can go either side.
English can say "twice" early in the sentence. Here the count goes after the verb.
Ask with 几: 你去过几次?