A defendant is liable as an accomplice when he
(1) gives assistance or encouragement (or fails to act when there is a legal duty to do so)
(2) with the intent of aiding another in the commission of a crime.
The defendant needs to be aware of the criminal act the person being aided intends, and is liable for all crimes that were reasonably foreseeable (for instance, assault and even murder are reasonably foreseeable consequences of a bank robbery.) The person committing the underlying crime does not need to seek out assistance, or even be aware that it has been given.
The person committing the underlying crime dose not need to be found guilty for accomplice liability to attach. However, the crime does need be completed. If the crime is aborted, there is no accomplice liability. But, be sure to look at whether any other crimes were committed, such as attempt.
Sale of ordinary goods for regular prices does not count. If you go into a hardware store, tell the clerk that you need an axe to kill your wife, and he shows you the axes and sells one to you, he is not liable. If you ask for a special axe to be custom made for the purpose of killing your wife, then he is an accomplice.