I won't expand on how to build a proper NPC, give him a true identity, taste and above all moral ethics, and a past he should be able to tell when asked (or a past that should lead to have links with other NPCs),but here are two things you should consider to reach your goal:
Make him intelligent/skillful
Most NPCs are, well NPCs... They don't achieve great things because the players are expected to do that. If this NPC is to be an equal to the rest of the crew, don't hesitate to have him do some badass things, or come up with great idea.
In a nutshell, create it like you are a player going to play it for a long campaign.
However, the key is balance, you don't want him to be the wise or mighty mentor that will lead the team, or even turn PC into mere sidekicks. This will come along while playing, you will have to carefully take his decisions, make him give clever suggestions that don't solve the whole plot, fortunately you are the DM, so you can tailor challenges taking this help into account, thus giving an illusion of helpful character without doing all the job for the players.
Tie him to PCs
If you want to avoid unnecessary conflicts, it's simple, put the NPC into one or more of the players background, I mean put it seriously like family ties or long friendship. Make him faithful to the rest of the crew.
But keep in mind that the smoother the character, the more you are likely to make him a convenient prop. Your NPC should be able to come up with its own ideas and oppose to the PCs when they make stupid plans or make suggestions on his field of expertise.
Unless your players are really uncomfortable with it, make a romance (or a bromance). I mean a complicated one, not a stereotypical YousavedMeMyPrinceLetsMarry, a love triangle should be even more interesting, although not unnecessary conflict proof.