Of the postwar PMs...
Attlee continued to lead Labour until the Party's defeat in the 1955 election, after which he resigned his seat following elevation to the peerage.
Churchill only stood down in 1964 (two elections after his retirement).
Eden resigned from the Commons a few months after resigning as Prime Minister. Given that he almost immediately regretted doing so we can assume he was probably off his face on amphetamines at the time.
Macmillan stayed on as an MP until the first election after his resignation (1964).
Douglas-Home remained an MP until the October 1974 election (and actually served in Heath's government).
(Wilson)
Heath, of course, remained an MP until the 2001 election which was held 27 years after he lost office.
Wilson remained an MP until the 1983 election.
Callaghan remained an MP until the 1987 election, only hanging on in 1983 due to his personal vote.
Thatcher remained an MP until the 1992 election.
Major remained an MP until the 2001 election.
Blair resigned as an MP immediately following his retirement as PM.
Brown remained an MP until the 2015 election.
There was a former PM in the Commons almost continuously from at least 1922 to 2001, with the exception of a few months in 1945 after Lloyd George got his peerage.