Using spectroscopy the chemical composition of exoplanets atmosphere is determined. As a scientist, what spectral lines would you look for?
Which elements are relevant in pursue of a second earth?
If you are asking about second earth for us Carbon based life forms then atmospheric composition of "second earth" should be similar to Earth. Primarily Nitrogen and Oxygen. Some green house gases like CO2, CH4, water vapors for temperature regulation. Water Vapors can also be sign of active water cycle. Some O3 will be nice for UV protection.
While not strictly relevant to your question, I'm very much looking forward to what the James Webb Telescope might tell us about exo-planet atmospheres. That's probably the thing I'm most looking forward to in astronomy discoveries over the next 5-10 years.
The one thing I've heard that they are looking for specifically is a combination of Oxygen (which implies Photosynthesis) and CH4 which, in combination with oxygen implies bacterial digestion of plant matter (aka cow farts). Those 2 things together are of particular interest because CH4 and O2 tend to interact with each other, so, if not regularly produced they aren't likely to both be present, at least, in measurable amounts. Other factors like plate tectonics, Methane escaping from the ground or under the oceans, comet impacts and perhaps even lightning might make such readings a little bit unreliable, but as I understand it, that combo, CH4 and O2 is the big one to look for.
Other interesting things might be a CO2/O2 ratio, also implying photosynthesis and perhaps telling us something about plate tectonics or O2 respiration. Variation in H20 content which could tell us something about weather, if the planet has freezing/thawing periods like Mars or vast deserts and few oceans and little water or occasional hurricanes. Dust particles could tell us something about the soil or volcanic activity. I would think NH3 content in abundance might be an indicator of little or no life, but I'm not positive there. Water with ammonia oceans might be possible and still have life, though we might find that not a good planet to live on.
Finally habitable is a term that needs a bit of exploration. Lets use the Earth as an example some 2 billion years ago, there was Oxygen in the atmosphere, there was CO2 in the atmosphere, there were oceans, there was a magnetic field, there was even an ozone layer, so it had everything Knu8 listed, but, there were no trees, there wasn't even any soil. There might have been a thin microbial layer living on the rocky surface or, if too hot, perhaps in caves. There were no fish, there wasn't even any good plants or krill like things growing in the oceans for fish to eat. It was mostly one celled life mostly just in the oceans and perhaps lakes. Earth 2 billion years ago might not be our first choice for habitation. It was also prone to photosynthesis driven snowball earth periods as well as having no soil and no trees.
There's also the question as to whether we'd want to inhabit an "earth-like" planet. Bacteria can be pretty hostile and if there's life on the planet, it might not be safe to settle, and there would also be ethical questions. If there's no life, then the Ethics isn't an issue, but there's likely a lot more terraforming. It's all relatively moot given the difficulty of that kind of space travel, but "habitable" is a more difficult question than it first appears. Our technology might be able to make a dead planet habitable over time, where as a planet with life on it might appear more habitable but could pose unforeseen problems. I'm not sure which would be more ideal.
I'm not an expert in this, but what to look for in exoplanet atmospheres for habitability is a little complicated and I've only touched on it briefly. Fun thing to think about though.