You say 辛苦你了 (1) to someone who has completed a task or favor that you asked him or her to do (to express appreciation for the "hard work" he/she did), or (2) to someone who is experiencing difficulty or trouble in life, and you say this expression to show your empathy.
你辛苦了 means approximately the same thing, but here "you" is the subject, In the first sentence, "you" is the object. So 你辛苦了 sounds more like "you have exerted effort" whereas 辛苦你了 sounds more like "this task burdened/exerted you," but in general they can be used interchangeably. I would say that I generally use 辛苦你了 more often.