These instructions are not merely cultural as they are derived from some scriptures or the other.
Lord Shiva gives the various rules of salutations for the disciple to follow in KulArnava Tantram's 12th chpater. Few of them are as follows:
Tato named gurum vApi gurvAgyAm na vicharayet |
Praguroh sAnnidhau
shishyah swagurm manasa namet ||
Therefater, the disciple should salute his Guru (by touching his feet)
without waiting for Guru's orders. But if Praguru is also present
there, then the disciple should salute his own Guru only mentally.
12.110
Praguru means the Guru of the Guru (also known as Param Guru).
Various rules are their for salutations for various personalities:
Guroh pranAm tritayam jyesthAnAmek eva cha |
PujyAnAmanjalim tad
vadanyeshAm vAkya vandanam ||
Guru should be saluted three times, the elders one time each. The
worship-worthy persons should be saluted by joining the hands whereas
everyone else can only be greeted through words.
12.111
When to do the ShAstAnga PranAm and when not to:
YAg jheshthAbhivAdena kramikAshtanga yogatah |
Gurushcha kula
vrikshascha vandanauyau vidhAnatah ||
The Yag-elder must be saluted simply by saying -- "I salute you". But
the Krama-elder must be saluted with a ShAstAnga pranAm. The Guru and
the Kula-trees must be honoured as per the precribed rules.
12.124
(Note: These terms YAgjyeshta, Kramajyeshta etc are Sampradyaic terminologies and I am not being able to explain them properly here).
Rules for saluting elders etc:
PitrimAtrAdi sarveshu pujyakotishu vandhushu |
AbhuthAna
pranAmAdyairvyakto dosha bhAgvahih ||
The parents, other elders, and respect-worthy relatives and friends
must be duly shown respect by getting up and with salutations. If such
respect is visibly not shown, it is considered as an offence.
12.125
Similar rules are also found in the Smritis. Few verses from Apastambha Dharma Sutras:
8When he meets the teacher after sunrise, however, he should clasp his
feet; 19at all other times he should exchange greetings, 20although,
according to some, he should embrace the teacher’s feet even at other
times. 21After he has pressed his teacher’s right foot from the bottom
to the top with his right hand, he should clasp it at the ankle.
22Some say that he should massage both feet with both hands and clasp
them both
APasthmabha Dharma Sutras 1.6.2. 18-22
In the presence of the teacher, moreover, he should not clasp the
feet of a person of lesser dignity than the teacher, 30greet such a
person using the name of his lineage (A 2.11.15 n.), 31rise to meet
him, or get up after him, 32even if that person happens to be his
teacher’s elder.
29-32
When his teacher and his teacher’s teacher are together, he should
first clasp the feet of his teacher’s teacher and then try to clasp
his own teacher’s feet, 20but the latter should forbid him; 21in the
presence of his teacher’s teacher acts of reverence to his own teacher
are suspended
1.9.1. 19-22
To his mother and father he should show the same obedience as to his
teacher. 7 A student who has returned home should clasp the feet of
all his elders (A 1.6.32 n.); 8 he should do so when he returns from a
journey as well. 9He should also clasp the feet of his brothers and
sisters according to seniority.
1.14.6-9
ShAstAnga and PanchAnga PranAm:
These are also mentioned in scriptures. Quoting portions from this answer:
Ashtanga is "eight limbs". SAshtanga is "with eight limbs". So, prostration which is done by involving the eight particular limbs of body is called the ShAshtanga Namaskara.
Here is the formal definition from Viswa SAra Tantram :
PadbhyAm KarAbhyAm JAnubhyAmurasA SirasA DrisA VachasA ManasA Chaiva
PranAmohashtAnga Iritaha |
..................
A prostration which is done by employing the following eight limbs is called
the Ashtanga PranAm - Two feet, two hands, two knees, chest, head,
two eyes, speech (Vakya) and mind.
For PanchAnga PranAm:
BAhuBhyAnchaiva JAnubhyAm SirasA VachasA DrisA PanchAngohayam
PranAmaha SyAt PujAsu Prvaravimau |
..............
The prostration which is done by involving the following five limbs - Two hands, two knees, head, speech and mind - is
called the PanchAnga PranAm. Both these prostrations are prescribed
during PujAs