OK, there are two absolute rules about combinations of quarks (and antiquarks): The combination must have an integer charge, and it must have neutral color. Quarks always have a charge of either +2/3, or -1/3, and antiquarks always have a charge of either -2/3, or +1/3. Thus, possible valid combinations include three quarks (like a proton, -1/3 + 2/3 + 2/3 = +1), or a quark and an antiquark (like a pi-, -2/3 -1/3 = -1), or three antiquarks (like an antineutron, -2/3 + 1/3 + 1/3 = 0).
Quarks (and antiquarks) also have color. Quarks can be red, green, or blue, while antiquarks can be antired, antigreen, or antiblue (I know, very imaginative names there). A color and its opposite cancel out, and all three colors together (or all three anticolors) in equal amounts also cancel out. Again, we see that the allowed combinations include three quarks, three antiquarks, or one of each.
As a point of nomenclature, things made from three quarks are called baryons, things made from three antiquarks are called antibaryons, and things made from one of each are called mesons.
So far, all of this is absolute. But there are other combinations of quarks and antiquarks that also meet the criteria. Take any set of baryons, antibaryons, and mesons, and squish them together into a single particle, and you’d still be satisfying those two rules. Are these possible? Well, that depends on the exact details of how the strong nuclear force work, which aren’t entirely known. Some certainly are possible: For instance, if you combine a proton and a neutron together, you get a deuteron, the nucleus of a deuterium atom, which is known to exist and is stable. In fact, you can combine a great many different combinations of protons and neutrons into nuclei, stable or otherwise.
Other combinations, though, we don’t know. The most mainstream models of the nuclear force (or at least, the models which were the most mainstream until now) say that you can’t have combinations of a total of four or five particles, but there are a great many variant models which are taken seriously, and which do allow for such particles. Finding a tetraquark is a bit surprising, since pentaquarks are predicted by more of the models than tetraquarks, but it’s not completely earthshaking.