After never, rarely, hardly, not only, only then — invert subject and auxiliary: Never have I…
Never have I seen such a beautiful sunset.
When a negative adverbial like 'never' begins a sentence, you must invert the subject and auxiliary verb. Use the present perfect 'have I seen' to match the general present meaning, not 'I have seen' (no inversion) or 'I saw' (simple past, no auxiliary to invert).
Hardly had I sat down when the phone rang.
After 'hardly,' invert the subject and auxiliary verb, and use past perfect 'had I' to show that one action (sitting down) was almost complete when another action (phone ringing) interrupted it; 'I had' has no inversion and 'have I' uses the wrong tense.
Not only was he late, he also forgot his keys.
The phrase 'not only' requires subject-auxiliary inversion; 'was he' correctly inverts 'he was' in past tense, while 'he was' lacks inversion and 'he is' uses the wrong tense for a completed state.
Rarely do we see such talent in one place.
The negative adverbial 'rarely' requires inversion of the subject and auxiliary verb in the present tense; 'do we see' inverts correctly, whereas 'we see' has no inversion and 'we saw' uses simple past without an auxiliary to invert.
Only then did she understand what had happened.
The restrictive adverbial 'only then' requires inversion of the subject and the past tense auxiliary; 'did she understand' inverts correctly, while 'she understood' lacks inversion and 'she did understand' reverses the inversion order.
No sooner had we left than it started to rain.
After 'no sooner,' invert the subject and use past perfect 'had we left' to show that leaving happened just before the rain started; 'we had left' has no inversion and 'we left' lacks the auxiliary verb needed for inversion.
Seldom have I seen him so happy.
The negative adverbial 'seldom' requires inversion of the subject and auxiliary verb; 'have I seen' inverts the present perfect correctly, whereas 'I have seen' lacks inversion and 'I see' uses simple present without an auxiliary.
Under no circumstances should you leave the building.
A negative prepositional phrase like 'under no circumstances' at the start of a sentence requires inversion of subject and modal auxiliary; 'should you' inverts correctly with the appropriate modal, while 'you should' has no inversion and 'must you' uses a different modal.
Little did he know that everything would change.
The word 'little' used as a negative adverbial requires inversion of the subject and auxiliary verb; 'did he know' correctly inverts in simple past with 'did,' whereas 'he knew' lacks inversion and 'he did know' reverses the inversion order.
So tired was he that he fell asleep immediately.
When an intensifying phrase 'so + adjective' begins a sentence, invert the subject and auxiliary verb; 'was he' correctly inverts the past tense 'to be,' while 'he was' has no inversion and 'he had been' uses the wrong auxiliary form.