I’m rusty, is that 4 and 16 color grayscale? It’s not real easy within PS unless you have a color table set up already.
Use the export to web, select gif format, select grayscale for the palette, then select the number of colors you want. You could probably then change the file format with PS if you need to.