I would say that the error is raised, because your resulting query supplies only 3 columns when the @RequiredIDID != 2. C# has analyzed the stored procedure and always expects 5 columns.
This could be solved by supplying 2 extra columns when the @RequiredIDID is not equal to 2. For instance change the ELSE part of your code to:
else
begin
SELECT FloorSpace.SpaceFrom, RealEstateCategoryDetails.RequiredCategoryTypeName,
NULL as FloorTypeCategory, NULL as FloorNotes,
RealEstateTypes.RequiedType
FROM PersonalRealStateDetails INNER JOIN
FloorSpace ON PersonalRealStateDetails.FloorSpaceID = FloorSpace.FloorSpaceID INNER JOIN
RealEstateCategoryDetails ON PersonalRealStateDetails.RequiredCategoryTypeID = RealEstateCategoryDetails.RequiredCategoryTypeID INNER JOIN
RealEstateTypes ON RealEstateCategoryDetails.RequiredID = RealEstateTypes.RequiredID
end
This should make the code work. I hope it give the desired result.