I grew up in a pretty religious (evangelical) family. Naturally, I believed what I was taught: the actual religious stuff like love your neighbors and enemies, be humble and kind, and so on. But also that evolution is a hoax, sex before marriage is the worst thing imaginable other than being gay, scripture should be taken literally, etc. Although I never was a bigot, I was ostracized and bullied at school, so I never had many friends. I did make some friends at church. But my experiences with other people have usually been not so great, so I usually have a hard time connecting with people.
Being pretty curious (and having plenty of time), I have now spent a few years reading extensively about the foundations and history of my faith, the group dynamics involved, what kind of ethical views are possible, etc. I would still call myself a believer, but my newfound views are regarded by my church friends as "liberal" and "secular", and I am basically being told I am an apostate.
I do try and tailor my reactions to people depending on which group they're in, but by now my church friends have started avoiding me altogether because I don't share their beliefs enough while my (few) non-believing friends always seem to keep me at a distance because for them my beliefs are too much (they still think I am a lunatic fundamentalist although I never really was).
An example interaction with a church friend could go like this: we meet to talk about life is going. As for these people (and me) "meaningful" discussions are very important, invariably, some religious topic comes up, like "kids shouldn't be baptized". I tried to gently state my point of view ("kids may be baptized"), but my friend is clearly uncomfortable with this, saying that if "one" goes down this road it leads to "liberal theology" (code word for apostasy).
Regarding non-church friends: an example is that a very close friend basically stopped telling me about his relationships (a big topic in his life, and thus something I as his friend would like to be supportive about) because they frequently change. I have never said anything critical about this in general, although I have sometimes asked him what his long-term life goals are regarding relationships. And, since the two are in conflict, how his goals relate to his current endeavors. But he will in the discussion frequently "jokingly" bring up things which makes it clear he assumes I think his behavior is bad in general. Maybe I should somehow make it clear that I don't think like the caricature fundamentalist in his head, but I would find it pretty awkward to address this directly.
How can I retain my relationships with both groups of people, and have people to discuss topics like this with?