I want you to imagine a scenario.
Let's say one day you were plucked from your home and dropped in an enclosure with a tiger. The tiger is far stronger and faster than you. It could kill you without even trying. So what do you do? You keep your distance. You watch it to make sure it's not coming closer. You sleep with one eye open.
Now for the question. If that tiger was actually kind and gentle and wanted to be your friend... how could it convey that to you? It can't exactly walk up and start rubbing on you. If it tried, you would run away, and if you were cornered, you'd probably attack it to make it back off. If it grabbed you and forced you to hold still while it licked your face? You'd be sure you were going to die, and even if it let you go afterward, you wouldn't know if it was testing the waters to perhaps kill you next time.
The best thing that tiger could do would be to ostensibly ignore you. No staring or any obvious attention in your direction. If you seemed frightened or angry, it would move away... every single time. It would, in effect, let you have full control of your interactions. If you learned you could simply say "shoo" and it would immediately walk away, well... that's a lot less scary, isn't it? And maybe you'd test it a dozen times... was it REALLY that easy to make the tiger leave? It wasn't just a coincidence? Did it work even when the tiger was clearly interested in you? And eventually, if saying "shoo" worked every single time, you might even work up the nerve to pet the tiger, secure in the knowledge that you could send it away with a word.
The way to earn trust is to be trustworthy. Watch his body language for any sign of nerves. In order, these are usually 1) a suspicious stare, 2) leaning away, 3) moving away.
Learn to recognize that suspicious stare. (He'll have his head turned to focus one eye on you). Feathers slicked down. Tense and unmoving. That's your signal to back off and leave him alone. If he's moving away, you've already pushed too far.
Let HIM control your interactions. If you're unsure about whether something means he's afraid or comfortable... move away. If he was afraid, he'll be relieved. If he wasn't afraid and actually wanted something else, he'll work out a clearer/different signal for next time, or may even move toward you of his own accord. Look for his version of "shoo" and OBEY EVERY TIME, even if it's inconvenient. Sometimes you'll have no choice but to press on (to clean the cage or change the food, to provide medical treatment), but remember that every push = a step backward in your relationship. Ask yourself if the thing you're trying to do is worth torching all your prior efforts, and act accordingly.
There's no way to predict how long it will take him to learn to trust you. That's entirely up to him. But if you give him control of the situation by letting him dictate whether you come closer, making sure he never feels cornered, and listening when he tells you, even very slightly, to back off... eventually he'll come around.