Planet Jupiter (Brihaspati) is the symbol for Knowledge, Wisdom, Progeny, Prosperity, Name & Fame, Wealth and Justice. The legend that marks the history of Brihaspati Puja or Guru Puja goes as follows:
In ancient India, there was a king who was blessed with seven sons and his wives. Queen used to return two Brahmins empty handed who used to come in their kingdom for begging alms. Thus, God Jupiter (the most powerful planet in the solar system) was displeased with them. This adversely affected the prosperity and wealth of the King. The youngest queen started giving alms to the Brahmins but still the elder queens denied alms to the Brahmins. Devastation struck in their kingdom and resulted king to face poverty.
The youngest wife asked for the remedy from the Brahmins to overcome crisis and bad days. The two Brahmins advised the queen to observe fast for Brihaspati diety on every Thursday (i.e. on Brihaspati vaar) and feed Brahmins. Since then Brihaspati Puja came into the practice in Hindu culture.
Indian women make two human figures behind main door of the house if their husband has gone to a foreign country. This results in early & safe return of the husband. If someone’ family is stricken with poverty then human figures are made on a box.
Source: https://www.brihaspatipuja.org/brihaspati-puja-in-history.html