Hi,
There is no rules about it : this is more a question of sonority than a real grammar problem.
You can use them both, but for some phrases one will be heavy, or make the phrase sound weird. But that would be grammatically correct anyway.
Best regards,
Chris