The chance of being able to double spend the transaction reduces as the number of confirmation increases until it eventually becomes zero at exactly 6 confirmations when the transaction has been validated successfully.
The chance isn’t zero entirely at 6 confirmations but rather it’s probably is very low as more blocks get mined on it and this chance is also base on the percentage of hashing power that the attacker controls.
~
In general If you’re aren’t good in Mathematics as explained above by hosseinimr93, here is a tool by
jlopp to calculate the risk base on each hashrate percentage and the corresponding confirmation number