A scrum is finished when the ball has come out of the scrum.
Once it has, then the opposition scrum-half can tackle their opposite number for the ball.
But in some situations the number 8 may dribble with the ball, keeping it in the scrum.
This means the opposing scrum-half cannot get their hands on the ball because it's still in the scrum.
This often happens when the team in possession have an attacking scrum near their opponent's try line.
RETAKING A SCRUM
The referee is in charge on the pitch and if he's not happy with a scrum, he can order it to be re-taken again when:
The scrum has rotated 90 degrees
The scrum has collapsed before the ball has been fed or before the ball has come out
The ball does not come out quick enough