Translation:He had never treated me so well before.
Well, in general, subjects do precede verbs in English declarative sentences. What alterrnative translation are you thinking may work? "Never before had I been treated so well by him." It works for me, but Duolingo will probably not let this pass. The meaning is, however, the same. I think it changes the sentence from active to passive voice or some darn thing.
Should allow "Never had he treated me so well before", right? I'm a native speaker of english and as far as I know it's completely fine to put that at the end of sentences, at least in an informal context.