Why is ammonia a nucleophile?
Ammonia is a nucleophile because it has a lone pair of electrons and a δ⁻ charge on the N atom.
A nucleophile is a reactant that provides a pair of electrons to form a new covalent bond.
Sound familiar? This is the exact definition of a Lewis base. In other words, nucleophiles are Lewis bases.
A nucleophile is either a negative ion or a molecule with a δ⁻ charge somewhere.
Ammonia doesn't carry a negative charge. But it has a lone pair of electrons. And nitrogen is more electronegative than hydrogen, so the nitrogen atom has a δ⁻ charge.
So NH₃ can act as a nucleophile and attack the δ⁺ C atom of an alkyl halide.
Here's a video on ammonia as a nucleophile.