There is one very simple rule about prepositions. And, unlike most rules, this rule has no exceptions.
Rule: A preposition is followed by a "noun". It is never followed by a verb.
By "noun" we include:
noun (dog, money, love)
proper noun (name) (Bangkok, Mary)
pronoun (you, him, us)
noun group (my first job)
gerund (swimming)
A preposition cannot be followed by a verb. If we want to follow a preposition by a verb, we must use the "-ing" form which is really a gerund or verb in noun form.