Past simple with 'be': were you / was she.Present simple with 'be': am I / are you / is he.
With two verb tenses where we just change the places of the verb and subject: If there's more than one verb, because a verb tense has auxiliary verbs for example, we move the first verb. In most English verb tenses, when we want to use inversion, we just move the verb to before the subject. Inversion just means putting the verb before the subject. We use inversion in several different situations in English.