A home passport photo works when the setup is right and fails when it is not, and almost all of that is decided before the shutter: distance from the wall, direction of light, camera height, and who is holding the camera. Selfies are not accepted for document photos, so you will need someone else to take it.
Almost every home photo failure traces back to two measurements: how far you stand from the wall, and where the light comes from.
A home photo is a fine choice for a digital upload. It is a weaker choice when the application needs printed photographs on specific stock, since the paper requirements are exact and most home printers cannot meet them.
It is also the wrong choice on a deadline. If two attempts have not produced even lighting, a booth or studio costs less than a rejected application.
For many applications yes, provided the photo meets the official rules on size, background, lighting, expression and sharpness. Some authorities and application routes still require a professional or booth photo, so check first.
No. Selfies are not accepted. The short camera distance distorts facial proportions, and the arm is usually visible in frame. Have someone else take the photo.
Soft, even light from the front. A large window on an overcast day is ideal. Avoid overhead ceiling lights, which cast shadows into the eye sockets and under the nose, and avoid direct flash.
Roughly an arm length or more from the wall so you do not cast a shadow on it, and far enough from the camera that the lens is not distorting your features. A step or two back with the camera zoomed in works better than standing close.
When the application needs printed photographs on specific paper, when the rules require a professional photo, or when you have tried twice and the lighting still is not even. A rejected application costs more time than the photo saves.