Subject-auxiliary inversion is triggered by fronting certain negative or restrictive adverbials (Never, Rarely, Not only, No sooner, Hardly, Under no circumstances), and also by so/such fronting for degree (So loud was the noise…) and comparative structures (As did his predecessor…). These structures are hallmarks of formal writing and rhetoric.
After certain negative/restrictive adverbials, the auxiliary comes before the subject. Choose the correctly inverted sentence.