captcha rules

Can captcha appears in a particular matter?

for example, when the user login mistake three times in a row, captcha will appear on the next request.

[solved] maybe there is another best way