A full treatment of what is required for a space win could fill a book (2 if you add pictures

)
WackenOpenAir wrote many good things, but there are some things that I might do differently.
Space races are all about tech pace, and this is split into two phases. Trading to parity and Self Research.
Trading to parity covers the expansion phase at emperor and above. Until you have established a viable core at these levels it is not generally possible to out research the AI to any meaningful extent, and often the best policy is to just get to literature as quickly as you can. Unfortunately, literature is an optional tech and therefore will delay your finish date somewhat, but being able to build libraries earlier pays dividends in the longer term - you will be able to get to four turn research that much quicker. Literature is the only optional tech you should research, and that includes Chivalry and Military Tradition.
The number of cities required depends on map size. The bigger the map the more cities will be required. This is because tech costs vary with the size of the map. Generally however 20 cities is not even close to enough for a normal map. 40 may possibly be adequate and more is even better.
As a general rule (which I break frequently BTW) I will have at least one city that produces settlers, and another that produces workers. All cities that have minimal corruption get a library as soon as possible (to the extent that I pre-build for them), all cities that are 30 to 80% corrupt get couthouses. The power of courthouses in a space game cannot be over emphasised since you will have them for 250 turns. Once courthouses are built then libraries go in these cities, and after libraries - marketplaces. At about this time you will be changing government to Republic. It is the only viable government for Space races. Also construction will be around, so obtain it and pre-build universities with colloseums, enter the MA and max research to Education. Make sure you sell/gift all the opponent scientific civs into the MA first. You can then choose to research a tech other than the free ones they get. You can use republic to buy the free techs if necessary, otherwise just be patient and wait to learn a new tech, and trade for the free ones. Don't be afraid to gift the AI into a new era, even if you are giving them 10 techs. They get all these new techs at once and they start building all sorts of stupid stuff that will take them the rest of the game to complete. If you have played well, you should be able to research at about 6 turns per tech. You will keep the slider as high as you can for the rest of the game.
Once you are around 10 turns from republic you can then begin military expansion. Select around 6 cities that can make horsemen quickly with minimal shield waste, build barracks here and then units. You MUST go to war at this stage or earlier in vanilla or PTW (C3C it is a little less important but still by far the best policy). For vanilla and PTW you MUST get the Forbidden Palace, and for this you need to generate a leader. Horses are best for doing this because of their surviveability. It is not the end of the world if you have no horses as a sword rush can be performed. The mechanics for this is a little more complicated since you need to generate cash for warrior upgrades, but normally this can be done by selling republic around. Particularly you should sell republic to your chosen victim since he will immediately revolt and this will interrupt his production and put him in a war weariness producing government.
If you have an AA UU then now is a good time to trigger a GA. Otherwise wait for the start of the Industrial age as this is optimal.
Once you have your leader and selected a suitable site for the FP you may be able to switch some courhouses to libraries. They have the same shield cost so you can't lose anything. Continue slow steady military expansion with your limited troops. If war weariness affects you then trade for luxes if you can, otherwise sue for peace and declare on another Civ. You will be at war for the whole game! The Aim is to get to the domination limit and to eliminate all but the scientific civs from the game. The fewer opponents on the map, the cheaper techs are to research. VERY IMPORTANT!
Research the top half of the tech tree - no optional techs. By the time you get to the end of that branch you may find that you can trade for invention.
The reason that you research the top is that it takes longer, and so gives the AI more time to research something for you. Also it delays magnetism which is often useful for keeping the other civs isolated. You can gain contacts through suicide galleys - they can't, and so keeping magnetism back will allow you to broker better deals for longer. Once you begin to research the lower branch you should find yourself at a comfortable 4 turn/tech pace.
The last tech you will research will be metallurgy, at which point you will once again gift the scientific civs into the Industrial age, and set research to something other than the free ones. You have no brokering opportunities here, and so you will have to research new techs in order to trade. By this time most of your non corrupt cities will have a library, a marketplace a university and 5 cities will have banks. Banks do NOT help directly with research. They only multiply gold that is not already going into research, and since you are running max science will see very little benefit. However... you want 5 stock exchanges for Wall street and for that you need 5 banks.
At this time select your most commercially productive city - often the capital, but can be the FP city. You will be putting Copernicus and Newtons in this city. The increase in beaker output is significant and worth the shield outlay. Pre-build for Copernicus as soon as the city has a library, market and uni.
Steam is the next important tech. Because you have taken great care to produce 1.5 workers for every city in your possesion, you will now have improved all workable tiles, and prepositioned all your workers in two groups. 1 around the captal and one around the FP. Organising you workers into gangs of 6 native, or 12 slaves you will then methodically rail the core(s). Don't worry about connecting all your cities up, it will happen in good time. The key is not to improve tiles where the improvement will go to corruption - just yet. Improve all the flat land first. Then the hills, then the mountains, and finally the corrupt extremities of your 50+ city empire.
At this point you will once again be researching the top half of the tech tree, immediately pre-building factories in all productive cities with banks (and stock exchanges where banks already exist), and with suitable wonder builds or UU you will be in a GA right now. 4 turn research is often only possible early in the IA under a GA. And agian the reason for reasearching the top branch is to get a tech for free - either medicine or electricity or both. Research all of the techs you can before starting Scientific Method. Save flight till last, and whilst researching this start a couple of prebuilds. One will be for TOE and the other hoovers. Make sure there is fresh water in the 21 tile X for the hoover pre-build
Time the TOE completion to be on the turn you learn Electronics. Often you hear that taking Atomic Theory and Electronics as your Free Techs from TOE is best. It is not. It is just safest. I prefer a slightly riskier Radio and Fission. Fission is very expensive and could take 10 turns to research. The risk is that when you gift your scientific civ (currently researching weather patterns somewhere deep in the arctic

) into the modern age he might get fission as his freebie. It's annoying and has happened to me.
Now you should select the cities that will build space ship parts. Space ship parts are not expensive particularly, but they should be micromanaged well to give to the option of speeding up and slowing down production to time builds.
Get your workers to irrigate everything you can now outside the radii of the half adozen cities that will build parts. You want a population explosion with lots of specialist scientists to give the extra little boost.
It would be wrong of me to suggest an optimum research path for the end game. My preference is to prebuild research labs everywhere and research ecology first and then to lazer. Theoretically it gives more time for rocketry (the cheapest modern age tech) to be researched. It has never worked for me however. You could research straight to miniturisation and build the internet for free labs everywhere.
So you pre-build apollo and all the parts and then press launch circa 1250AD give or take.
Obviously this is a very rough guide but it should give you enough information to develop your own strategy later.
The interesting point is that your finish date is pretty much determined by about turn 80 and whether or not you have managed to research literature, have half a dozen libraries and 15 cities at this time. )