The correct option is B when
A conjunction combines or connects two sentences as one. When one of them depends on the other for its full meaning, that clause is the subordinate clause ("she saw her neighbour drive by"), and the clause it depends on is the main clause ("She was standing at the bus stop"). Here, we require a time-related conjunction as both clauses are in terms of the events (standing at the stop, seeing her neighbour) occurring at a particular time. From the options, 'when' is the most suitable option, as it demonstrates an interruption, there's a very short lapse in time between 'she is standing at the bus stop' and 'she saw her neighbour', they both don't occur at the same time, but the second activity interrupts the first, hence we use 'when' and not 'while'. 'While' is used when two activities are taking place simultaneously, but here they aren't. Hence option B is correct and A is incorrect. 'But' is a coordinating conjunction used when both clauses are independent and do not depend on the other for their full meaning, and is used to express a contrast in meaning between these clauses. But here we don't need a coordinating conjunction, and the clauses are not contrast-related, hence option C is incorrect. 'For' is also a coordinating conjunction, used when one clause is inferred or deduced by another, and that isn't the case here, hence option D is incorrect.