The Millennium Falcon had been powered down and mothballed for years, so it was undetectable, but it's safe to assume Han and Chewie were passively looking for it. After all, it was "stolen" from him, and he wanted it back.
I think it was mentioned by Han himself that they detected it pretty much right away. Remember, there was lots of chatter on the airwaves that the First Order was looking for a ship of that specific model.
So, when the ship that he loves so dearly all of a sudden come up on the sensors, it makes all kinds of sense that he's going to go after it. They didn't just stumble across each other by chance. They simply got lucky that they had Han's ship.
Anyway, the only thing I would change is the sequence where Rey travels from the Resistance base to find Luke. It looks like she got there in 30 seconds. They could have edited it a bit better to make it appear like much more time had passed.