It is rare that someone other than the monarch receives a state funeral. Occasionally prominent national figures are accorded this honour. Only the following four PMs (Prime Ministers of the United Kingdom) have had state funerals:

Arthur Wellesley, 1st Duke of Wellington (1769-1852) served twice as PM. Wellington died at Walmer Castle in Kent. His body was taken by train to London, where he was given a state funeral in St. Paul's Cathedral on 18 November 1852.

Henry John Temple, 3rd Viscount Palmerston (1784-1865) was twice PM. Although Palmerston wanted to be buried at Romsey Abbey, the Cabinet insisted that he should have a state funeral and be buried at Westminster Abbey, which took place on 27 October 1865.

William Ewart Gladstone (1809-1898) served four terms as PM. Gladstone died at Hawarden Castle, North Wales. His state funeral took place in Westminster Abbey on 28 May 1898.

Sir Winston Leonard Spencer Churchill (1874-1965) served as PM twice. Planning for Churchill’s state funeral had begun 12 years before his death under the code-name of "Operation Hope Not". His coffin lay in state at Westminster Hall for three days and the funeral ceremony was at St Paul's Cathedral on 30 January 1965.

Sometimes the offer of a state funeral would be declined by the relatives of the deceased PM. Some distinguished PMs were given a ceremonial funeral rather than a state funeral.

More Info: en.wikipedia.org