If you mean you have thought someone had just been kidding with you, so, that both those actions have happened in the past (and so the action "to be kidding" must have happened before you could acknowledge it, before you thought it), then you should use "I thought he was just kidding".