There is really only one method to obtain the location of the spacecraft, and this is via carefully tracking the spacecraft from the ground. Usually they determine the range by a process called, well, ranging, basically they send a ping to the spacecraft, which responds as soon as it can. The time it takes for the probe to respond determines it's exact range. If you have its range for a few time samples, and you know the gravitational constants of everything, you can determine what trajectory the spacecraft is on. This method is very good, and works well.
Other methods are usually only used if the location of the target body isn't very well known. These can include images, radar, and similar systems from the spacecraft to determine where the object is. This is because knowing the exact position of some objects can be difficult, and more accurate measurements can be made from close. However, this will only tell you where the object of interest is relative to the spacecraft. The spacecraft is determined by the ranging operation.
Very close objects can also be found via a ground based radar system.