When is the strong nuclear force repulsive and when is it attractive?
Let’s not confuse the strong interaction with the nuclear force (which is a residual effect of the strong interaction). The strong interaction is always attractive. It binds quarks into hadrons (protons, neutrons, etc) and does not diminish with distance. For this reason, quarks are never found outside of the hadrons, as it would take enormous energy to separate them. The nuclear force, on the other hand, is responsible for the binding of protons and neutrons into atomic nuclei. It is attractive force at short ranges, but at much smaller separations between nucleons the force is very powerfully repulsive.