1. Someone you have told a secret.
2. Someone who has accepted a favor from you.
Notice that I have cleverly defined a friend in terms of things you give and not things you receive. If you are evaluating your potential friends in terms of what they can give you, or how they can entertain you, you probably don't have many friends.
I read somewhere that telling a secret makes the recipient of the secret automatically bond to you. It puts the giver of the secret in a vulnerable position and it changes the receiver into a protector. That's halfway to being friends.
The second rule is simple but powerful. We accept favors from strangers all the time, without any expectation of becoming friends. But we don't also share secrets with those strangers. It is the combination of the secret and the favor that nudges an acquaintance into a friend.
Most people are wired to reciprocate. So if you go first with your secret and your favor, the recipient will be primed to do the same. It is the willingness to reciprocate that matters.
Obviously you don't want to give a dangerous or important secret to an acquaintance in hopes it will lead to friendship. You want to hold back the good stuff and start with something small. For example, lets say you are both at a dinner party and your host served duck. At the dinner table you told the host the food was wonderful, but later and privately to your would-be friend you jokingly confess that you hate duck. That's a secret, but a tiny one. You don't want to start out with your deepest secrets. Work into that over time.
Likewise with the favors, keep them tiny at first. You might have some special knowledge to share that costs you nothing but a few minutes of your time. Or perhaps you had a conversation about a vacation spot and you forwarded an e-mail with a link that your potential friend might find useful. It's a tiny favor and will be accepted. You don't want to start right off offering to drive someone to the airport at 4 AM.
This partly explains why people who work together, or play sports together, naturally become friends. You have lots of opportunities to share small secrets and perform minor favors. And of course you have lots of things to talk about. That helps.
The secret and the favor are necessary but not sufficient for making a friend. You still need some basic chemistry and common interests. But chemistry and common interests aren't things you can easily change. So if you find a candidate for a friend with whom you have some chemistry and common interests, work on the secret and the favor. Those you can control.