While Loop controller execute its samplers until the condition specified is not set to False. The condition can be any variable or function that eventually evaluates to the string 'false'.
So, you need to specify a variable or function in While Loop, that has value 'true' and becomes 'false' somewhere else in the script. Once it changes to 'false', JMeter will exit the While loop.
For example if you are using a X-Path extractor in your script which have a variable named Status and its value changes from 'Start' to 'Finish' during the execution and you want to execute your script till 'Finish' has not been met, then you can use the expression ${__javaScript("'${imp_Status}'!='finish'",)}
in your While loop and it will execute the samplers under While controller till the status = finish is met.
I have used the same in an eCommerce site, where the condition was that 'User is not allowed to Check-Out products until he purchases items of some amount X' i.e. minimum amount for Check-Out. So we have stored this value of items to be purchased in a Variable and then used the same in While Loop, so that until amount not reached to X, keep of adding products using the samplers which are inside the While loop controller. Once the amount become >= X, the While loop exits and proceeded to Check-Out.
You can refer to below links for more details
https://stackoverflow.com/questions/7886132/jmeter-while-controller
https://stackoverflow.com/questions/30452343/how-to-use-while-loop-in-jmeter
http://jmeter.apache.org/usermanual/component_reference.html#While_Controller