Compress last, after cropping
Do the steps in order. First crop the photo to the shape the application asks for, then compress it to the size limit. Compressing first and cropping afterwards re-saves the photo twice and can push it back over the limit.
If a form gives both a pixel size and a KB limit, the pixel size comes first. Crop to those exact pixels with the passport photo cropper, then bring the file under the limit here.