How it is worked out
The classical rule is given in a short verse: "saika tithir vara-yuta kritapta, sheshe gune 'bhre bhuvi vahnivasah". Take the number of the tithi, counting from Shukla Pratipada as 1 to Amavasya as 30, add one, add the number of the weekday (Sunday as 1 to Saturday as 7), and divide by four. If the remainder is three or zero, Agni is on earth. If it is one, he is in the sky; if two, in the netherworld.
For example, on Shukla Panchami (5) falling on a Thursday (5): 5 + 1 + 5 = 11, which divided by 4 leaves 3, so Agni is on earth and a homa may be done. Because the tithi changes during the day, the Agnivasa can change too, at the moment the tithi ends.
When it matters
Agnivasa is checked for optional (kamya) homas: a havan for a wish, a graha shanti, a Chandi homa, a Ganapati homa for a new venture. It is not checked for the daily fire rituals (nitya agnihotra), for homas that are part of a samskara such as a wedding or thread ceremony, or for homas on fixed festival days like Navratri, which are performed on their day regardless.
With the other checks
A priest choosing a day for a homa also looks at the Homahuti, the graha whose mouth receives the offerings that day, and at the tithi, nakshatra and weekday as for any muhurta.