A primary amine nitrogen carries two hydrogens and one carbon. Match those and leave the secondary and tertiary amines, and the amide, alone.
Convert between chemical structures and SMILES in both directions, search a list of structures by substructure or SMARTS, and learn the notation step by step. Everything runs in your browser — no structure you open ever leaves your machine — so the tool needs JavaScript.