the difference between legend and non-legend drugs

Source: Food and Drug Administration (FDA)

Legend drug is a drug that, by law, can be obtained only by prescription and bears the label, "Caution: Federal law prohibits dispensing without a prescription."
But, nowadays, the label simply states "RX only".

Federal and State laws mandate that all prescription drugs bear a "legend" prohibiting sale without a prescription. On most original drug packaging today the legend simply says "Rx only".

Non-legend drug means a drug which does not require dispensing by prescription and which is not restricted to use by practitioners only. In other words, it is a drug that does not require a prescription and is available "over-the-counter."