Most golfers know that causing their ball to move incurs a penalty of one stroke, under Rule 18-2, and that the ball must then be replaced.
However, there are some circumstances where a player does not incur a penalty for accidentally moving their ball, which I am listing here.
A ball that that has been placed in the teeing ground at the start of a hole is not in play until a stroke has been made at it, so no penalty is incurred if it is accidentally moved before any stroke is made, Rule 11-3.
From 1st January 2017 USGA and R&A have recommended that Committees introduce a Local Rule to the effect that when a player’s ball lies on the putting green, there is no penalty if the ball (or ball-marker) is accidentally moved by the player, their partner, their opponent or any of their caddies, or their equipment. (Note: If your Committee has not yet introduced this Local Rule they should do so immediately).
There is no penalty if a player causes their ball to move while moving a movable obstruction (i.e. anything artificial), providing the movement of the ball is directly attributable to the removal of the obstruction, Rule 24-1.
A penalty is usually incurred if a ball is accidentally moved while searching for it under Rule 18-2, but there are four exceptions, which are detailed in Rule 12-2. Briefly they are; a) searching for or identifying ball covered by sand, b) searching for or identifying ball covered by loose impediments in hazard, c) searching for ball in water in water hazard, and d) searching for ball within obstruction or abnormal ground condition.
If a player accidentally touches their ball with their club causing it to rock off its spot, but it returns to its original position, it has not moved according to the Definition of Moved and no penalty is incurred, Decision 18/2.
There is no penalty if a player accidentally moves their ball while measuring, e.g. to determine whether a dropped ball has rolled outside the permitted area, Rule 18-2.
If a player accidentally moves their ball in the directly attributable act of its lifting, marking, placing or replacing under a Rule, there is no penalty and the ball must be replaced, Rules 20-1 and 20-3.
Regarding searching for a ball, it is worth noting that if a player who is searching for their ball, say on the bank of a water hazard or in a bush, and they cause it to move, they incur the penalty of one stroke immediately and cannot avoid it by then choosing to take relief under penalty from the hazard or deeming it unplayable in the bush.