The phrase to leave no stone unturned means to try every possible course of action in order to achieve something.
(The equivalent French phrase has a cosmic dimension since it is remuer ciel et terre, literally, to move heaven and earth.)
The image of turning every stone was already proverbial over 2000 years ago in ancient Greece; the playwright Euripides (circa 485-406 BC) used it in Ἡρακλεῖδαι (= Hērakleidai, Children of Heracles – around 430 BC):
Should not I, who am hated by these children and aware of their inherited hatred of me, have left no stone unturned¹ in machinations to kill or exile them?
(translation: David Kovacs – Loeb Classical Library, 1995)
¹ The Greek text is πάντα κινῆσαι πέτρον (= pánta kinēsai pétron), literally, to have turned every stone.
According to the American author John Bartlett (1820-1905) in Familiar quotations: being an attempt to trace their source (Boston – 4th edition, 1865), to leave no stone unturned
may be traced to a response of the Delphic Oracle, given to Polycrates, as the best means of finding a treasure buried by Xerxes’s general, Mardonius, on the field of Plataea. The Oracle replied Πάντα λίθον κίνει, Turn every stone.
Bartlett mentions a story supposed to have taken place in 479 BC, when the second invasion of Greece by the Persians, in the reign of Xerxes I (circa 519-465 BC), was brought to an end. According to a rumour, Xerxes’s general, Mardonius, who was killed at the battle at Plataea, had hidden a treasure under his tent or close to it. A certain Polycrates of Athens or Thebes, trusting this rumour, bought the site and dug for the treasure. Finding none, he asked the Delphic Oracle how he could find it, and received the reply Πάντα λίθον κίνει (= Pánta líthon kínei), literally, Turn every stone.
However, in The Delphic Oracle: Its Responses and Operations, with a Catalogue of Responses (University of California Press – 1978), Joseph Fontenrose writes that the proverbial phrase used by Euripides
certainly precedes the story of Polycrates, which seems to be a fable, the moral of which is a warning against greed or credulity.
The earliest known instance of to leave no stone unturned is from A manifest detection of the moste vyle and detestable vse of Diceplay, and other practises lyke the same, a Myrrour very necessary for all yonge Gentilmen & others sodenly enabled by worldly abūdace, to loke in. Newly set forth for their behoufe² (London – circa 1555):
The chetor³ for the most part neuer receyueth his scholler⁴ to whom he wil discouer the secrets of hys arte, but such one as before he had from some welth and plenty of things, made so bare, and brought to such misery, that he wil refuse no labor nor leaue no stone vnturned, to pick vp a penny vnderneth.
² for their behoufe: for their behoof, i.e. for their benefit
³ chetor: cheater in the sense of a dishonest gamester
⁴ scholler: scholar, in the sense of a pupil, a disciple