What this rule checks
Classical definition: If a graha other than Surya occupies the 12th house from Chandra, Anapha Yoga is formed. In modern terms: At least one of Mars, Mercury, Jupiter, Venus or Saturn is in the 12th house from the Moon, which is the sign right before the Moon's sign. The Sun is not counted. Rahu and Ketu are not counted either. Houses are counted from the Moon's sign: the Moon's own sign is the 1st. Source: Brihat Parashara Hora Shastra, Chapter 37, verses 7-10; Phaladeepika, Adhyaya 6, sloka 5 (V. Subrahmanya Sastri's translation); Jataka Parijata, Adhyaya 7, slokas 72-73 (V. Subrahmanya Sastri's translation).