Well in addition to Dominic's interpretation, it sounds kind of tricky if I don't know your intention. If you mean that you thought but were wrong that he has been there (unreal situation) then it's I thought you had been here before.... other wise it could be I thought you have been here before.