readily available on google
Flags should be flown at half-mast on the following occasions:
From the announcement of the death until the funeral of the Sovereign, except on Proclamation Day when flags are flown at full-mast following the proclamation.
From the announcement of the death until the funeral of a member of the Royal Family styled ‘Royal Highness’, subject to special commands from the Sovereign in each case.
On the day of the announcement of the death and on the day of the funeral of other members of the Royal Family, subject to special commands from the Sovereign in each case.
The funerals of foreign Rulers, subject to special commands from the Sovereign in each case.
The funerals of Prime Ministers and ex-Prime Ministers of the United Kingdom, subject to special commands from the Sovereign in each case.
The funerals of First Ministers and ex-First Ministers of Scotland, Wales and Northern Ireland, subject to special commands from the Sovereign in each case. Unless otherwise commanded by the Sovereign, this only applies to flags in their respective countries.
At British Embassies, High Commissions and Missions when flags in the host country are flown at half-mast, subject to the discretion of the Chef de Mission.
Any other occasions where the Sovereign has given a special command.
If the body of a very distinguished citizen is lying in a building, the flag should fly at half-mast on that building until the body has left.
Flags at full-mastA Stand of Flags at Full-mast
Flags at half-mastThe Same Stand at Half-mast
An alternative mark of mourning, used when half-masting is unsuitable, is to add a black cravat or ribbon to the top of the flag, at the hoist.
The above cover Royal and National Mourning, but flags may be flown at half-mast on private or non-Government buildings on other relevant occasions. Flags fly at full-mast on Remembrance Sunday.
where i live, flags are often flown at half mast when a police officer passes away. local officials who held public office such as a mayor.
i think it's respectful