The winner is the qualified horse and rider that finishes first. A horse is qualified if it has run the race without fouls, and it had a rider that has also had no fouls. A horse by itself is not qualified.
It’s a very dangerous situation because a lot of times a horse will panic if the jockey falls off, it was very fortunate that no other horses/jockeys were in peril.
That’s probably true, but then why is a race won “by a nose” referring to the horse’s nose and not the jockey’s nose?