Spanish Object Pronoun Position
Object pronouns (direct, indirect, and reflexive) usually precede the verbs they modify. However, in the case of infinitives, present participles, and affirmative commands, they often get attached to the end of the verb instead.
Object Pronouns with Infinitive
When one or more pronouns are used with a verb in the infinitive (including the perfect infinitive), the pronoun(s) are usually attached to the end of the infinitive.
Salió sin verlo - He left without seeing it.
Limpié la casa para venderla - I cleaned the house to sell it.
If the infinitive is immediately preceded by a conjugated verb, the pronoun(s) can either precede the conjugated verb or be attached to the infinitive.
Lo quiero vender / Quiero venderlo - I want to sell it.
Me voy a lavar / Voy a lavarme - I'm going to wash up.
When double pronouns are attached to an infinitive, an acute accent must be added to the last syllable of the infinitive, in order to maintain the correct stress on the word.
Quiere vendérnoslo - He wants to sell it to us.
Voy a dártelo - I'm going to give it to you.
Object Pronouns with Present Participle
When pronouns are used with a present participle or progressive tense, the pronoun(s) can either precede the helping verb or be attached to the participle.
Lo estoy mirando / Estoy mirándolo - I am watching it.
Las estábamos mirando / Estábamos mirándolas - We were looking for them.
Note that when the pronoun is attached to the participle, an accent must be added to the original stressed syllable in order to maintain the correct stress on the word.
Object Pronouns with Imperative
When object pronouns are used with negative commands, they precede the verbs. However, for affirmative commands they must be attached to the end of the verb.
¡No me ayudes! - ¡Ayúdame!
Don't help me! - Help me!
No se vaya (Ud.) - Váyase.
Don't go away. - Go away.
No lo comas - Cómelo.
Don't eat it - Eat it.
No me la traiga - Tráigamela.
Don't bring it to me - Bring it to me.
Again, when object pronouns are attached, an accent must be added to the verb to maintain the proper word stress.