The short answer: one coat of a good primer, two coats of a thin one, and the argument you will find online exists because both camps are describing different products. What decides it is the solids content: a primer at around 28 percent volume solids is thin enough that professionals recommend two coats, while one at 38 percent seals new drywall in a single pass. Buy on solids rather than on price per gallon and the question answers itself. And check one restriction before you start, because the dedicated drywall primers are often the cheapest option and several of them must not be topcoated with a glossy paint at all.
Disclosure: this post contains affiliate links, and as an Amazon Associate I earn from qualifying purchases. If you buy through them I may earn a small commission at no extra cost to you. I only recommend things I would use in my own home.