In formal styles, when we use an adverb with negative meaning (e.g. never, seldom, rarely, scarcely, hardly) or an expression beginning with not (+ a prepositional phrase or a clause) in front position for emphasis, we invert the subject (s) and auxiliary (aux)/modal verb. Here’s a great explanation on video with examples:
A complete list of easy exercises (drag and drop) are available in random idea english.
Practise with a film and activities based on it.
More stuff if you want further practice in pdf inversionexercises2.