Alright. The basics of stellar formation.
It starts with the death of another star. A supernova goes and a star blows off tons of material into space. The shock wave from this explosion hits other clouds of gas and dust that are scattered everywhere throughout the galaxy. These clouds are huge. Hundreds of light years across. And thin by human standards - if you were flying through one, you'd never know it. Anyway. This shock wave causes the giant cloud to start collapsing in on itself from the very weak but present gravity. As the cloud collapses, it starts to spin. Technically, it was spinning very slowly already, but the collapse makes it spin faster. (Like an ice skater pulling in her arms to spin faster.) As it collapses more, areas with just a little more density become "knots" of material that start pulling nearby gas in. Each of these knots - of which there are hundreds - will become a star system. Some knots are big and will make huge stars that die quickly and make more shock waves, most are small stars that will burn for tens of billions of years. Eventually, each little knot is dense enough to ignite fusion and a star is born. The pressure and radiation from the new star blows most of the gas to the "outer" parts of the system and the dust stays in the inner part of the system. The chunks of dust collide and grow until you have planets. In the outer areas, they do the same, but then start collecting gas, making gas giants. Some of these giants can then migrate inwards (through processes that are still only barely understood). Voila. A star system.
So.... factors that can affect formation and life.
Let's go back to when the knots are collapsing into stars. If we have a huge knot, it turns into a massive star. Massive stars live fast and die young. In fact, they die before a lot of the other star systems are done forming. They explode as supernovae and the explosion blows away the dust and gas from nearby systems, stripping them of any planets that may have been forming and usually blowing away some of the forming star as well. This is what makes habitability in a forming system difficult. Even if you're on the outskirts and in a system that's already formed, you're regularly getting flooded with radiation from exploding giant stars. And not UV "eh, I can handle it" radiation. It's X rays and gamma rays.
If we have a migrating "hot jupiter", those usually sweep up and destroy forming planets as well, so if you make a system with a gas giant close to the star, reduce your number of rocky planets.
That's what messes with formation. As for life, we already mentioned radiation. There's only one other rule. Water. Water is special in that its an excellent solvent for so many chemicals. Anything living has to be able to get information and nutrients around to the different parts of the body or cells. Liquids are the easiest way of doing this and water is one of only a few that genuinely work for all the complex molecules you'd need. (I'm not a biologist, so I can't tell you more than that.) Since liquid water is the only requirement, all you have to do is ask yourself, "is there a place on this planet where I can get liquid water?" For that, see this thread. So if you want to know what would prevent life, all you have to do is think on what could be preventing liquid water. Too hot, too cold, not enough air pressure, a planet with chemicals that react with water to remove it all, etc etc.