The first sentence of LewisMiller's answer here summarizes it:
There are no easy and simple answers when it comes to questions about the nuclear force. The force between two nucleons is a complicated residual interaction that leaks outside the color confinement walls of the QCD strong interaction. It is best visualized as due to exchanges of quark - antiquark pairs or mesons.
Your question is similar to the question "how do atoms join into molecules since they are neutral?" and you can see my answer here .
There are spill overs from the strong interaction too ; due to the probabilistic nature of quantum mechanics there is always a probability that within a nucleon a virtual pion (because it is the smallest energy boson) will form. That can "travel", has a probability to exist, outside the space bounds of a proton or neutron. This cannot be very far, because it is virtual (within an integral), but far enough to interact with another proton or neutron. This qualitatively explains the successes of the first nuclear models , which developed before quarks were even imagined into existence.
There are other exchanges too, as you will learn if you read the link by Lewis,the basic point to keep is that the nuclear force is a spill over force, due to the probabilistic nature of quantum mechanics and the quantum number symmetries that allow color neutral virtual meson combinations.