Today, Shane McAnally is a mainstay in Nashville's songwriting community, with 40 No. 1 hits to his name, numerous industry awards and, most recently, a spotlight role on NBC's new televised songwriting competition, Songland. Long before all that, however, McAnally hit a financial rock bottom in 2007, losing his home and his car after years of trying to make it in the industry. Simultaneously, he was struggling with his sexuality, unsure if the music industry would accept him if he came out as gay.

McAnally tells People that it was during this difficult period of his life when he met his now-husband, Michael Baum, during a trip to Palm Springs, Calif. Although the songwriter initially assumed it wouldn't turn into anything serious, the pair began a long-distance relationship, and it became clear that McAnally would need to come out in order to keep Baum in his life.

"He was not a person that could be told, 'I'm going to keep this a secret.' He was like, 'If we're gonna be together, I can't hide,'" McAnally explains. "At that point, I had had no success anyway. I had lost my house. I had lost my car, and I met someone that was saying, 'I love you anyway, except I can't do this if you're in the closet.'"

Despite his nerves about how the country music industry might react, McAnally began to publicly identify as gay. Rather than it hurting his career, embracing his sexuality made McAnally a better songwriter.

"Before, I was always worried about the pronouns I was using. I worried: 'Will a good ol' boy sing a song if a gay guy wrote it?'" he continues. "I was in the closet. And it was represented in my work. That stopped because I met my husband ... One of the things that changed was the authenticity. I was telling the truth."

Sure enough, McAnally began to score big-name cuts: In 2008, Lee Ann Womack recorded one of his songs, and his career quickly began to pick up steam. McAnally says that his sexual orientation hasn't really affected his career much since he came out -- especially since his songs started going No. 1.

"It was like no one noticed," he admits. "I never had anything but open arms from the professional community. I was starting to have hits, that also really helps -- people want to work with you because of your success. And so luckily that didn't play into it."

McAnally has written hits for artists including Miranda Lambert, Kenny Chesney, Florida Georgia Line, Luke Bryan, Tim McGraw and a slew of others. As a producer, he has also worked with Little Big Town, Old Dominion, Midland, Walker Hayes and many more.

Country Stars Who Have Come Out as Gay