preSolve and postSolve callback methods in contact listeners will be helpful here. You can set SetEnabled(false) in the preSolve() method so that box2d will not calculate required forces to be applied on the bodies. i.e. box2d will skip the collision. But note that this is applicable only for that particular time step duration only. In the next box2d time step the collision will be calculated. In order to skip the complete collision between rock and the bird for the first two times you need to call the SetEnabled(false) in every frame but with a check. So for e.g.
Take an integer in the rock body's userdata. And in every time step you just call SetEnabled(false) and increment the integer until the integer becomes 2. Once this is 2 then next time onwards dont call SetEnabled(false). By default it will set to SetEnabled(true). And during the third hit the box2d will apply forces on the rock body.
You must read http://www.iforce2d.net/b2dtut/collision-anatomy
Specifically read the preSolve and postSolve callbacks.