If you use the search function you will find many threads on this subject. Many of them contain some quite detailed advice on repainting a bicycle.
If you want a good-looking result, my advice is to clean the frame down to bare metal and concentrate on getting a really excellent base preparation job. Don't be afraid to let spray can primer cure for a week or so before moving on to the next step.