Nucleophile in a reaction
Here are some rules i remember from organic chemistry in Collage.
When trying to distinguish between nucleophile and base, 


Look for resonance
If atom is involved in resonsance, this makes ato/group more nucleophilic, 
if electrons are more localized its more basic.
Eg. A carboxylate is a nucleophile, the -ve charge is delocalized (i.e - charge is  spread out across carbonyl and oxyanion. Compared to nitrogen on an amine,  electron are restricted.


Sterics, 
more sterics less nucleophilic.
Smaller radius atoms, valence electrons are more localized in space, thus more basic. Big radius atoms, poor localization relative to small, thus more nucleophilic.
More electronegastive, less basic
Electronegativity is a measure of the nuclear positive charge effect on near -ve charges. 
The more electronegative the less basic. Because the atom doesnt want to give up its electrons. Why? Because it has high electronegativity
Conduction effects
If there are electronegative atoms within 3 bonds (taking into account electronegativities, and proximity) more nucleophilic less basic.



Nitrogens are usually bases, oxygens nucleophiles. I swear it was always like that. Halogens are weak nucleophiles. 

Will edit for legibility when i get to computer