Unable to Understand the concept of OOB completely


I am getting a bit of confusion in understanding the concept of OOB.
When we train by saying set_rf_samples(5000) does that mean that each of our estimator will randomly sample 5000 data points and will train over that and for all the other data points it will calculate the r squared which is termed as OOB score.

Please help me understand this thing properly.