Characteristics of the اسم (Noun)
Ibn Hisham says:
فاما الاسم فيعرف: بال كالرجل, والتنوين كرجلٍ , وبالحديث عنه كتاء ضربتُ
The Ism is known by one of three characteristics: By being proceeded by ال, by التنون (nunnation), and by being talked about. The first of these is a characteristic at the beginning of the Ism, the second is at the end, and the third is one of meaning. It suffices for a word to have one of these for it to be a noun.
Ibn Hisham then goes on to categorise nouns as either معرب (declinable) or مبني (indeclinable).
The Mu'rab is that which has an ending that changes because of various different operators acting upon it. The Mabni is that which does not change but is fixed. Most nouns in Arabic are Mu'rab. Ibn Hisham therefore proceeds to discuss those that are Mabni.
The Mabni nouns can be put into four categories as follows:
المبني على الكسر
He further subdivides this section into those words regarding which there is agreement, and those that are contentious.
There is no disagreement amongst Grammarians that هؤلاءِ is Mabni 'AlalKasr. But there is disagreement regarding others, including أمسِ and حذامِ
المبني على الفتح
احدَ عشرَ and its sisters fall into this category, excluding اثنا عشر
المبني على الضم
The examples he gives here are the six directions: وراء امام فوق تحت يمين شمال and also قبل , بعد, اول , دون.
He discusses قبل and بعد specifically in detail, and here is gets more complicated. These words are mu'rab in 3 cases, and mabni in 1. They are mabni if the مضاف اليه is deleted, but the meaning is intended, for example in Surah Aroom v4.
As far as I can tell, what applies to قبل and بعد above also applies to the six directions.
المبني على السكون
He gives the examples of كمْ (How many?) and مَنْ (Who?).