The problem is most likely in the carburetor. There are some small passages that are restricted or plugged.
Here might be what I call an emergency fix, but I want you to still read the rest of the answer as this may be just a temporary if it works.
The nut that holds on the carburetor bowl has several small holes in it. Some are on the sides and one may be in the end. In order to completely clean the carburetor correctly, you MUST clean these holes with a tag wire or a jet drill. (If a jet drill is used, DO NOT use a drill that is bigger than the hole or the engine will run too rich.) If the Picture does not show up, click on the Blue Text and you will see the picture. There is ONLY 1 picture. The picture may not look exactly like yours but it should be very similar....even if you have an adjustable jet screw...but the tiny holes may be on the sides of the jet instead of the middle.
Here is my comprehensive carburetor and fuel answer that may give you some ideas.
As engines sit or get older, fuel that is left in the carburetor can turn to gum and varnish and cause this and other problems. Also, any gasoline that was left in a gas can for a period of more than 30 days must be discarded because it also has begun to turn to varnish.
Today's gasoline's contain MTBE and alcohol. (Ethanol) They turn to "Junk and garbage" very quickly. Alcohol is partially water (H2O). And they call it "Oxygenated fuels! It is the oxygen that breaks down the organic compounds in the fuel and turns the gas to "Garbage" (Gum and varnish) The fuels we had just a few years ago had no alcohol in it and would store for longer periods of time before going stale... and fuel stabilizers do almost nothing to prevent the fuel from going bad with the changes in today's fuels.
Do not buy gas from the "Discount" Stations. The discount stations get a reduced price on gas because they may be buying fuel that is nearly 30 days old already. You may be getting fuel that's nearly stale right from the pump when buying from a discount station. Purchase your fuel from the well-known stations such as Shell, BP, Sonoco, Phillips 66 etc.
More than 70% of all of our repairs in our lawn mower business are due to this same issue. You most likely have dirt, gum, varnish...etc in your carburetor plugging up the small passageways and jets in the carburetor.
The carburetor must be removed from the engine. Clean all parts with carburetor cleaner and blow out all the small holes and passageways with compressed air. Remove all of the non-metallic parts since the carburetor cleaner will cause them to be disfigured decompose and plug the carburetor as time goes on.
Wash the carburetor cleaner off of the metal parts by washing them in warm, soapy water then rinsing with clean water. Dry them by blowing it off with compressed air. Make sure that all the passageways are blown dry before reassembling.
Reassemble using a NEW carburetor rebuild kit.
DO NOT TRY TO REASSEMBLE WITHOUT USING A COMPLTE CARBURETOR KIT! You will just end up having to do the job again.
ALWAYS clean the fuel tank and replace the fuel line when doing this repair or you may have to do it all over again. The inside of the fuel line disintegrates over time and these small pieces of rubber will plug up the carburetor too. Dirt and water from a dirty fuel tank will also plug up the carburetor. Find the Model, type and serial or code numbers off of the engine and take them to your local dealer to get the carburetor repair kit.
If you do the work yourself, take pictures or at least make a drawing of where all the linkages, gaskets, and component parts go. Correct reassembly is critical.
If the carburetor still doesn't work correctly, you may have to take it to someone who has an "Ultra-sonic" cleaning machine. This machine uses carb cleaner and ultrasonic vibrations to get the very small passageways clean when traditional methods fail.
Here is where you can get an inexpensive "Ultrasonic Cleaning Machine"
If you don't feel comfortable with this kind of repair I would suggest sending it to a reputable shop.
It starts when you put gas in the plug because the carburetor doesn't work right and isn't letting enough fuel into the engine to start it. when it does start with the gas in the plug hole, it is still not getting enough gas so it is running lean. If it is run very long like this, it can cause permanent engine damage.
The only other possibility is that the choke is not closing all the way..... that is.... if you particular engine has a choke..
But the usual problem is a restricted carburetor. Also, you MUST use Fresh gas. Do not EVER use gas that is over 30 days old. It not only will make it hard to start, but as it runs, it can cause the piston and cylinder to score because of the gum and varnish that forms inside the old gas.