YOLO is pretty deep waters. There are a bunch of threads from ai_curious which go into a lot of detail about how all this works. Here’s a good one to start with and then it links to some of the others.
The short answer to your question is that objects can span multiple grid cells, but they are only reported by the grid cell that contains their centroid. See the thread linked above for the real explanation.