An old devotee of Lord Rama was close to his death. He heard of Buddha and wanted confirmation on God’s existence. Buddha, knowing the man was a devotee, said there was no God.
Later a devout atheist who dedicated many years to spreading the atheist message came to Buddha and asked if there was a God. Buddha, knowing that man was an atheist, said firmly that there was a God.