When the ball is being bounced by the goalkeeper from his hands and a player steals it without touching the goalkeeper (while the goalkeeper is not touching the ball) and scores, is it legal or not?
No, it is not legal.
On page 122 of the 2015/16 FIFA Laws of the Game:
A goalkeeper is not permitted to keep control of the ball in his hands for more than six seconds. A goalkeeper is considered to be in control of the ball:
- while the ball is between his hands or between his hand and any surface (e.g. ground, own body)
- while holding the ball in his outstretched open hand
- while in the act of bouncing it on the ground or tossing it into the air
When a goalkeeper has gained possession of the ball with his hands, he cannot be challenged by an opponent.
Also, on page 123:
- It is an offence for a player to prevent a goalkeeper from releasing the ball from his hands
- A player must be penalised for playing in a dangerous manner if he kicks or attempts to kick the ball when the goalkeeper is in the process of releasing it
- It is an offence to restrict the movement of the goalkeeper by unfairly impeding him, e.g. at the taking of a corner kick
In summary, a single bounce of the ball is not enough to relinquish possession. Before the ball can be challenged for by an opponent, the keeper must have let it bounce away and no longer be able to either kick it (ie. a drop kick) or regather it in their hands or arms before it strikes the ground for a second time.
If the goalkeeper allows the ball to bounce on the ground multiple times, most referees will consider it released and therefore free to be challenged for by an opponent.
As an aside, by standing where he was, the opponent had probably already committed an offence by preventing the goalkeeper from releasing the ball from his hands (as mentioned in the second quote above), even before he challenged for the ball.