Get some autoflower genetics, they don't go much over 12"-18", some strains are even shorter.

You will have to top a plant early and often to bush it out to stay under 24".