How to use add_retention_policy method to retain only 1000 rows in my table?

How to retain only last 1000 rows from my table in Timescale? Want to delete all the other records using retention policy.