It’s pretty simple, the greatest good for the greatest NUMBER of people requires you to do the thing that benefits the most folks. This may not be the thing that brings about the greatest happiness overall.
You may have a forced choice to give everyone you know 1$ — or you can give one deserving family enough money to get out of debt and buy a car. Hmmm.. where’s the greatest happiness, all persons considered — clearly with the family.
It’s a bad formulation, don’t use it — even if Wikipedia does…