The pharmacy must be licensed by the state board of pharmacy in both the state where they operate and the state where you live.

The FDA recommends looking for these specific signs of a legal operation:

Nearly 95% of websites selling prescription drugs online are operating illegally. Avoid sites that: BeSafeRx: Frequently Asked Questions (FAQs) - FDA